Based on this converting-trained-tensorflow-model-to-protobuf I am trying to save/restore TF graph without success.
Here is saver:
The GraphDef.ParseFromString()
method (and, in general, the ParseFromString()
method on any Python protobuf wrapper) expects a string in the binary protocol buffer format. If you pass as_text=False
to tf.train.write_graph(), then the file will be in the appropriate format.
Otherwise you can do the following to read the text-based format:
from google.protobuf import text_format
# ...
graph_def = tf.GraphDef()
text_format.Merge(proto_b, graph_def)