【问题标题】:Error when using export_inference_graph: TypeError: export_inference_graph() got an unexpected keyword argument 'use_side_inputs'使用 export_inference_graph 时出错:TypeError: export_inference_graph() got an unexpected keyword argument 'use_side_inputs'
【发布时间】:2020-12-11 12:04:17
【问题描述】:

我目前正在训练对象检测模型。一切都很顺利,直到我想导出我的图表。

当我运行命令时

python export_inference_graph.py --input_type image_tensor --pipeline_config_path training/faster_rcnn_inception_v2_coco.config --trained_checkpoint_prefix training/model.ckpt-1606 --output_directory new_graph

我收到以下错误:

Traceback (most recent call last):

File "export_inference_graph.py", line 206, in <module>
    tf.app.run()

  File "C:\Users\dm\Anaconda3\envs\py37\lib\site-packages\tensorflow_core\python\platform\app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)

  File "C:\Users\dm\Anaconda3\envs\py37\lib\site-packages\absl\app.py", line 303, in run
    _run_main(main, args)

  File "C:\Users\dm\Anaconda3\envs\py37\lib\site-packages\absl\app.py", line 251, in _run_main
    sys.exit(main(argv))

  File "export_inference_graph.py", line 202, in main
    side_input_types=side_input_types)

TypeError: export_inference_graph() got an unexpected keyword argument 'use_side_inputs'

有谁知道我在这一步做错了什么?我正在使用 Python Python 3.7 来使用 Tensorflow 1.15.4。这只是非常令人困惑,因为我正在遵循一个教程,直到这一点一切都很好。如果有人知道如何解决这个问题,我将非常感激!

【问题讨论】:

    标签: python tensorflow object-detection


    【解决方案1】:

    看起来像你的issue

    我以某种方式设法通过了它。我在想我们的文件 已经不兼容了。有些已更新,有些则未更新。 所以我下载了一个非常旧版本的 export_inference_graph.py 从这里开始:

    https://github.com/datitran/object_detector_app/blob/master/object_detection/g3doc/exporting_models.md

    下面是要输入的代码:

    python export_inference_graph.py --input_type image_tensor
    --pipeline_config_path training/faster_rcnn_inception_v2_coco.config 
    --checkpoint_path training/model.ckpt-1606
    --inference_graph_path output_inference_graph.pb
    

    【讨论】:

    • 非常感谢!现在它可以工作了,但我不明白为什么这些文件不再兼容?您现在知道原因吗,为什么在我的情况下它不起作用,但 - 看起来 - 在大多数其他情况下都起作用?
    • 在问题的 cmets 部分中,假设您使用旧版本的源。确保您使用的是树顶(最新提交)。如果此解决方案有帮助,请将其标记为已接受的答案。
    猜你喜欢
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 2022-01-12
    • 2015-09-23
    • 2021-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多