Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading Tensorflow Session in Jupyter Notebooks #4488

Closed
aslotte opened this issue Nov 20, 2019 · 7 comments
Assignees

Comments

@aslotte
Copy link

@aslotte aslotte commented Nov 20, 2019

System information

  • OS version/distro: Windows 10 Home
  • .NET Version (eg., dotnet --info): .NET Core 3.0
  • ML.NET Version: v1.4.0.0

Issue

I wasn't sure if this issue belonged in /dotnet/try or here, but I figured I start here as I think it may be ML.NET related.

  • What did you do? Ran a Transfer Learning sample in Jupyter Notebooks
  • What happened? Got an exception from Tensorflow loading the TF model
  • What did you expect? .Fit() to work as expected

Source code / logs

Source code can be found here
https://github.com/aslotte/mlnet-jupyter/blob/master/src/image%20classification.ipynb

Exception:
image

@aslotte aslotte changed the title Error loading Tensorflow model in Jupyter Notebooks Error loading Tensorflow Session in Jupyter Notebooks Nov 20, 2019
@ashbhandare

This comment has been minimized.

Copy link
Contributor

@ashbhandare ashbhandare commented Nov 20, 2019

Hi @aslotte , was there an additional exception message? I see the call stack but cannot see what the exception was.

@aslotte

This comment has been minimized.

Copy link
Author

@aslotte aslotte commented Nov 20, 2019

@ashbhandare - no other exceptions as far as I could tell.

@ashbhandare

This comment has been minimized.

Copy link
Contributor

@ashbhandare ashbhandare commented Nov 21, 2019

Hi @aslotte , I took a look at your notebook, and looks like you have not installed the tensorflow nuget in the beginning.
Could you retry after adding the line:

#r "nuget:SciSharp.TensorFlow.Redist,1.14.0"
@ashbhandare ashbhandare self-assigned this Nov 21, 2019
@aslotte

This comment has been minimized.

Copy link
Author

@aslotte aslotte commented Nov 21, 2019

Thanks for the update @ashbhandare, I missed that.
I get another exception by doing that though:

image

@ashbhandare

This comment has been minimized.

Copy link
Contributor

@ashbhandare ashbhandare commented Nov 21, 2019

@aslotte I looked into your notebook, and looks like I am able to run the .fit() if I give the absolute path instead of relative.

var imagePath = @"C:\Users\..\Datasets\Computer Vision\fashion-product-images-small\images";

Your ImageData object should get the absolute path for the "ImagePath" column.

@aslotte

This comment has been minimized.

Copy link
Author

@aslotte aslotte commented Nov 21, 2019

Thank you @ashbhandare - that was exactly the problem! Would there be any room for improvement in regard to this path? Having an absolute path for an image dataset makes the Jupyter Notebooks less sharable. Thanks!

@codemzs codemzs closed this Nov 22, 2019
@ashbhandare

This comment has been minimized.

Copy link
Contributor

@ashbhandare ashbhandare commented Nov 26, 2019

Hey @aslotte , you don't need to hard code the path, you just have to make sure that the 'ImageData' object has the absolute path. See

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.