-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 a frozen graph ( float incompatible with float_ref ) #161
Comments
BTW, this error also happens when I load the .pb model in Python:
|
Refer to the following url. |
Hi @Lunrot, |
@mhaghighat |
Yes, it gives this error in Python:
|
my code
|
I had done the same, but the resulted protobuf was not loading successfully. The only difference between my code and yours was that I was feeding
However, if I change it to the way that you've done, creating
there is no error anymore. I know it sounds absurd, but this is the case!!! |
Since gd (=sess.graph.as_graph_def()) has changed in the bug finxing, gd shoud be used instead of sess.graph.as_graph_def(). |
I had the
but the resulted protobuf still had the issue. Maybe, it cannot alter the nodes in the original |
@Lunrot, thanks for your code. I made the same mistake as mhaghighat did(also thank @mhaghighat for finding out the difference). I noted that tf.gfile.GFile is replaced by tf.train.write_graph. What's the difference between the two functions? Can they be used for save/load interchangeably? I found some of the tensors' shape information are eliminated from the frozen model. For curiosity, I fed the network with some inputs with different shapes: |
@mhaghighat I think so. |
Hi @Lunrot, |
@ugtony |
@mhaghighat |
@mhaghighat |
@tengshaofeng |
@tengshaofeng:
For loading the protobuf graph in Python, you can use:
For loading it in C++, you can use:
|
This has been fixed in #172. |
@mhaghighat |
In my case , I had this error because I was saving the totally of my variable into constant. When I selected only the correct operations in the ouput_node_names, the loading was a success . EX: output_node_names = "Loss/predictions" |
I try to use Facenet by tensorflow C++ API (VS2015),it can load graph,but it doesn't work. could you give me a hand?thanks |
@cvJie: This works for me:
|
How can i modify the graph_def in session? if i do it in this way, the model saved by sess didn't change from RefSwitch to Switch. |
Hello I am facing this issue raise ValueError(str(e)) in line below code while loading frozen.pb file
here is my full code: with tf.Session() as sess:
train_writer = tf.summary.FileWriter(log_dir) |
FusedBatchNorm/Switch:1 incompatible with expected half error, |
hi I have the save error. do you fix it? |
The problem with batch norm nodes is fixed based on the following issues: tensorflow/tensorflow#3628 davidsandberg/facenet#161
The problem with batch norm nodes is fixed based on the following issues: tensorflow/tensorflow#3628 davidsandberg/facenet#161
I froze the 20170131-234652 model using the freeze_graph.py, but I cannot load it in C++.
I first read the binaryproto successfully as:
But, it gives an error while creating the graph to be used for the session:
The error is:
Any ideas how to solve this problem?
Thanks in advance :)
The text was updated successfully, but these errors were encountered: