DecodeError: Error parsing message
I encountered the following error when I was testing on the picture or calling the camera.
Traceback (most recent call last):
File "object_detection_tutorial.py" line 61,in
@LXWDL Could you give me a link or show me which file you ran to get the error? Thanks!
I'm also getting this error, and it seems to occur during any function that calls graph parsing protos. A simple example would be a standard use of tensorflow/python/tools/freeze_graph.py (including --input_binary=true), which returns the following:
Traceback (most recent call last):
File "tensorflow/python/tools/freeze_graph.py", line 382, in <module>
run_main()
File "tensorflow/python/tools/freeze_graph.py", line 379, in run_main
app.run(main=my_main, argv=[sys.argv[0]] + unparsed)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "tensorflow/python/tools/freeze_graph.py", line 378, in <lambda>
my_main = lambda unused_args: main(unused_args, flags)
File "tensorflow/python/tools/freeze_graph.py", line 272, in main
flags.saved_model_tags, checkpoint_version)
File "tensorflow/python/tools/freeze_graph.py", line 231, in freeze_graph
input_graph_def = _parse_input_graph_proto(input_graph, input_binary)
File "tensorflow/python/tools/freeze_graph.py", line 172, in _parse_input_graph_proto
input_graph_def.ParseFromString(f.read())
google.protobuf.message.DecodeError: Error parsing message
Somewhere I'd seen it suggested that variant sizes be changed to permit far greater values (in protobuf/io/coded_stream.h), but intuitively this seems hacky. And anyway, these results are consistent for protobuf 3.4.0 through 3.5.2.
I think the most likely case is that some variables are being called to be parsed that should be excluded from an inference graph popsicle. Would it really be so terrible to make name fields required? Noobies like me might go spending a bunch on gcloud ml-engine time only to get their results and realize they should have done that. Aside from extra keystrokes, I don't see how requiring reasonable organization is...well...unreasonable.
try this
_EXPORT_DIR='path_to_exported_graph' with tf.Session(graph=tf.Graph()) as sess: tf.saved_model.loader.load(sess, [tf.saved_model.tag_constants.SERVING], _EXPORT_DIR) trainable_coll = sess.graph.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES) vars = {v.name:sess.run(v.value()) for v in trainable_coll}
Closing this issue due to no response from the issue author. Feel free to reopen the issue when additional information is available. Thanks!
Same problem,but I have no idea....
I'm also getting this error, and it seems to occur during any function that calls graph parsing protos. A simple example would be a standard use of
tensorflow/python/tools/freeze_graph.py(including --input_binary=true), which returns the following:Traceback (most recent call last): File "tensorflow/python/tools/freeze_graph.py", line 382, in <module> run_main() File "tensorflow/python/tools/freeze_graph.py", line 379, in run_main app.run(main=my_main, argv=[sys.argv[0]] + unparsed) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 126, in run _sys.exit(main(argv)) File "tensorflow/python/tools/freeze_graph.py", line 378, in <lambda> my_main = lambda unused_args: main(unused_args, flags) File "tensorflow/python/tools/freeze_graph.py", line 272, in main flags.saved_model_tags, checkpoint_version) File "tensorflow/python/tools/freeze_graph.py", line 231, in freeze_graph input_graph_def = _parse_input_graph_proto(input_graph, input_binary) File "tensorflow/python/tools/freeze_graph.py", line 172, in _parse_input_graph_proto input_graph_def.ParseFromString(f.read()) google.protobuf.message.DecodeError: Error parsing messageSomewhere I'd seen it suggested that variant sizes be changed to permit far greater values (in protobuf/io/coded_stream.h), but intuitively this seems hacky. And anyway, these results are consistent for protobuf 3.4.0 through 3.5.2.
I think the most likely case is that some variables are being called to be parsed that should be excluded from an inference graph popsicle. Would it really be so terrible to make name fields required? Noobies like me might go spending a bunch on gcloud ml-engine time only to get their results and realize they should have done that. Aside from extra keystrokes, I don't see how requiring reasonable organization is...well...unreasonable.
Have you tried assigning --input_binary to False? I saw someone fixed the problem in this way.