【问题标题】:Object detection: Error with Export/Import for inference对象检测:用于推理的导出/导入错误
【发布时间】:2017-10-24 01:39:57
【问题描述】:

我是机器学习的初学者,目前正在尝试遵循以下链接中提供的教程https://github.com/tensorflow/models/blob/master/object_detection/g3doc/exporting_models.md

我已经完成了一个模型的训练,它给了我 model.ckpt 文件。下面是我在窗口命令提示符中输入的命令

{Your path}\tensor\flow\models\research>
python object_detection\export_inference_graph.py\
--input_type=image_tensor \
--pipeline_config_path="{Your path}\model\ssd_mobilenet_v1_pets.config" \
--trained_checkpoint_prefix="{Your path}\models\train\" \
--output_directory=output_inference_graph.pb \
1>mloutput.txt 2>mlerror.txt

所以当我检查错误文件时,这是我发现的:

Traceback (most recent call last):
  File "object_detection\export_inference_graph.py", line 106, in <module>
    tf.app.run()
  File "C:\Users\ericsen\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "object_detection\export_inference_graph.py", line 95, in main
    assert FLAGS.output_directory, '`output_directory` is missing'
AssertionError: `output_directory` is missing

我真的不明白为什么缺少输出目录。这纯粹是我的错误还是一个错误。您的友好反馈和帮助将不胜感激。谢谢

【问题讨论】:

    标签: python tensorflow object-detection


    【解决方案1】:

    我已经尝试打印所有参数并查看:

    trained_checkpoint_prefix = "{你的路径}\models\train\" \ --output_directory=output_inference_graph.pb \

    “{Your path}\models\train\”中似乎缺少“\”

    尝试在“train\”之后添加更多“\” --> “train\\”

    {Your path}\tensor\flow\models\research>
    python object_detection\export_inference_graph.py\
    --input_type=image_tensor \
    --pipeline_config_path="{Your path}\model\ssd_mobilenet_v1_pets.config" \
    --trained_checkpoint_prefix="{Your path}\models\train\\" \ 
    --output_directory=output_inference_graph.pb \
    

    【讨论】:

    • 哦,是的,这纯粹是我的错误。多加一个“\”后,错误日志显示程序找不到训练好的模型。所以我最后做的是添加 model.ckpt-#### 而不是“\”,它终于可以工作了。非常感谢 JerryB 的友好回答,非常感谢。
    猜你喜欢
    • 2019-09-08
    • 2020-04-03
    • 2021-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-02
    • 2020-04-21
    相关资源
    最近更新 更多