python valueerror object2_python – 导出推理图时出错(ValueError)

所以我正在关注sentdex的对象检测教程,我已经到了你应该导出推理图的步骤.我正在使用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

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有关,但我已经多次重新安装它并没有成功.

所有帮助赞赏

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值