运行TensorFlow对象检测API模型培训时出错

时间:2017-09-24 10:52:32

标签: python tensorflow macos-sierra object-detection

我正在按照 TensorFlow对象检测API 的指示,我正在尝试使用牛津猫数据集训练模型,我在指令上做了每一步,但培训过程并没有。开始并给出一些错误,任何有类似错误的人都可以与我分享经验吗?

我的系统是macOS Sierra 10.12.4,Python版本2.7.13

错误消息是

Traceback (most recent call last):
  File "object_detection/train.py", line 197, in <module>
    tf.app.run()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "object_detection/train.py", line 144, in main
    model_config, train_config, input_config = get_configs_from_multiple_files()
  File "object_detection/train.py", line 126, in get_configs_from_multiple_files
    text_format.Merge(f.read(), train_config)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 125, in read
    pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
    pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: .

我在控制台中运行的命令:

python object_detection/train.py --logtostderr --pipline_config_path=object_detection/models/pet_model/ssd_mobilenet_v1_pets.config --train_dir=object_detection/models/pet_model/train

1 个答案:

答案 0 :(得分:1)

更新

找到这个问题的答案,它是由一个错字造成的。命令应该是

python object_detection/train.py --logtostderr --pipeline_config_path=object_detection/models/pet_model/ssd_mobilenet_v1_pets.config --train_dir=object_detection/models/pet_model/train