Python Forum

Full Version: od_graph_def.ParseFromString(serialized_graph)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using this guy's code: https://stackoverflow.com/questions/4567...to-console
I get this error:

Error:
---> 28 od_graph_def.ParseFromString(serialized_graph) DecodeError: Error parsing message
I have been searching google and stackoverflow for solutions, nothing works. I installed tf 2.0.0 ---> nothing, tf 1.15.1 ---> nothing, tf 2.5.0 ---> nothing.

I tried this (source: https://stackoverflow.com/questions/5761...o-attribut) :

tf.compat.v1.GraphDef()   # -> instead of tf.GraphDef()
tf.compat.v2.io.gfile.GFile()   # -> instead of tf.gfile.GFile()
--> nothing.

I tried this :

with tf.io.gfile.GFile(path, 'r') as fid:
--> nothing...

Countless candidate solutions I have tried, absolutely nothing! I work on google colab! What is wrong with this line??
Countless?

Is there any way you can post a better error trace and actual code?
Countless yes! I mean this is crazy! With every new update on packages we need to re-invent the wheel in order to make a program work!

source: https://stackoverflow.com/questions/4567...to-console

The whole error as Google Colab returns it to me:

Error:
DecodeError Traceback (most recent call last) <ipython-input-1-538a457aa183> in <module>() 26 with tf.io.gfile.GFile(PATH_TO_CKPT, 'rb') as fid: 27 serialized_graph = fid.read() ---> 28 od_graph_def.ParseFromString(serialized_graph) 29 tf.import_graph_def(od_graph_def, name='') 30 DecodeError: Error parsing message
I have included the code....