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

Can't load the training model #2

Open
Trick3r opened this issue Aug 15, 2019 · 5 comments
Open

Can't load the training model #2

Trick3r opened this issue Aug 15, 2019 · 5 comments

Comments

@Trick3r
Copy link

Trick3r commented Aug 15, 2019

When I have tried to loading the model, I got this error
"{"NodeDef mentions attr 'explicit_paddings' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]; attr=dilations:list(int),default=[1, 1, 1, 1]>; NodeDef: {{node conv1/convolution}} = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true](conv1_input, conv1/kernel/read). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.)."}"

What am I doing wrong? here is the code for loading model
folderWithMNIST = @"D:\Tensorflow_C#\MNISTpng-master\MNISTpng\testing";

the rest of the code is same as you use

@sdg002
Copy link
Owner

sdg002 commented Aug 15, 2019

Hi @Trick3r ,
The resolution in migueldeicaza/TensorFlowSharp#444
might help you. In my case, the native Tensorlfow DLL had to be manually updated to get the C# to work.

@Trick3r
Copy link
Author

Trick3r commented Aug 15, 2019

@sdg002 ,
Thx for your reply, but when I have do it like you said in that forum, I got the same error, it seem install the tensor gpu version 1.13.1 doesn't help

@sdg002
Copy link
Owner

sdg002 commented Aug 15, 2019

My suggestion would be

  1. Use 1.14 of TF while training
  2. In your C# app, copy over the native tensorflow.dll from TF site and rename it as libtensorflow.dll in the Bin of your project. You will have to be careful because libtensorflow.dll from Nuget will keep updating the Bin folder. This is because TensorFlowSharp is delivering an older version of the native tensorflow.dll.

@Trick3r
Copy link
Author

Trick3r commented Aug 15, 2019

@sdg002 ok, thx, but could you please tell me, the model in the project that you have posted in Github, what version you use to train this model?, because I have try to run your code with your model and got the error

@geometrikal
Copy link

Please see my comment here for an easier way to get the dll:

migueldeicaza/TensorFlowSharp#444 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants