导出推理图时出错(ValueError)

Zelcore

因此,我遵循了senddex的对象检测教程,并且已进入应该导出推理图的步骤。我正在使用Tensorflow的object_detection文件夹中的“ export_inference_graph.py”脚本。问题是我收到此ValueError:

Traceback (most recent call last):
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\google\proto
buf\internal\python_message.py", line 545, in _GetFieldByName
    return message_descriptor.fields_by_name[field_name]
KeyError: 'layout_optimizer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "export_inference_graph.py", line 119, in <module>
    tf.app.run()
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\p
ython\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "export_inference_graph.py", line 115, in main
    FLAGS.output_directory, input_shape)
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\object_detec
tion-0.1-py3.5.egg\object_detection\exporter.py", line 427, in export_inference_graph
    input_shape, optimize_graph, output_collection_name)
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\object_detec
tion-0.1-py3.5.egg\object_detection\exporter.py", line 391, in _export_inference_graph
    initializer_nodes='')
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\object_detec
tion-0.1-py3.5.egg\object_detection\exporter.py", line 72, in freeze_graph_with_def_protos
    layout_optimizer=rewriter_config_pb2.RewriterConfig.ON)
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\google\proto
buf\internal\python_message.py", line 484, in init
    field = _GetFieldByName(message_descriptor, field_name)
  File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\google\proto
buf\internal\python_message.py", line 548, in _GetFieldByName
    (message_descriptor.name, field_name))
ValueError: Protocol message RewriterConfig has no "layout_optimizer" field.

我猜想它与protobuf有关,但是我已经将它重新安装了几次,但没有成功。所有帮助表示赞赏

用户名

也发生在我身上。几周前没有发生。在修复该错误之前,您可以使用仍然有效的早期版本。替换“ object_detection / exporter.py”中的第72行:

layout_optimizer=rewriter_config_pb2.RewriterConfig.ON)

与旧的工作线:

optimize_tensor_layout=True)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章