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

Import InceptionV3 throws "Invalid GraphDef" error #54

Closed
AdamStefan opened this issue Apr 18, 2017 · 7 comments
Closed

Import InceptionV3 throws "Invalid GraphDef" error #54

AdamStefan opened this issue Apr 18, 2017 · 7 comments

Comments

@AdamStefan
Copy link

Hi,
I've tried to import the InceptionV3 using the following code:
var model = File.ReadAllBytes(modelFile);
var graph = new TFGraph();
graph.Import(model, "");

-- Unhandled exception of type TFException "Invalid GraphDef"

It looks like for all graphs bigger than approx 70 Mb this exception is thrown.

Thx

@migueldeicaza
Copy link
Owner

Yeah, that seems to be a common problem with Tensorflow and Protobuf. I believe someone suggested a way somewhere to recompile the underlying protocol buffer implementation in libtensorflow with a larger buffer size. I do not recall where I saw that.

This is what stops one of our samples as well, the file is too large.

@migueldeicaza
Copy link
Owner

This is the tensorflow issue, it should be addressed if you upgrade your TensorFlow runtime:

tensorflow/tensorflow#582

@khanyuriy
Copy link

I have the same error, but my model less then 64MB.
How can i be sure, that TensorFlowSharp bindings are compatible with savedmodel file i have got?

@csharpner
Copy link

My model is only 84KB and I have another that's 69KB and I get this error on both of them. Latest version of TensorFlowSharp available in NuGet as of 2019-02-01 and TensorFlow 1.12.0. I've not been able to get TensorFlowSharp to work at all. Is there an alternative way to use a TensorFlow .pb model file from a C# app?

@codingyoutub
Copy link

I have the same problem. I made a pb file with a teachable machine, but it seems to be a compatibility problem. I think it's 2.3 version of pb. Did you find a solution?

@migueldeicaza
Copy link
Owner

I recommend you now use TensorFlow.NET which is being actively developed.

@Nevey
Copy link

Nevey commented Dec 16, 2020

I recommend you now use TensorFlow.NET which is being actively developed.

I can't explain why, but it's a pain in the ass getting that library to work in Unity. TensorFlowSharp seems a lot easier to deal with, but I'm also running into the TFException "Invalid GraphDef" issue. You said this has to do with the version of TensorFlow used to create the model? Any tips for me? (I'm running a python project to train data with tf version 2.3.1, then I want to read it in Unity)

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

6 participants