TensorFlow 对象检测 API 错误

TensorFlow Object Detection API error

我正在使用 Tensorflow 对象检测 API 来训练我自己的对象检测器。准备好所有需要的东西后:我把data/train.record, test.recordtraining/object-detection.pbtxt, faster_rcnn_inception_resnet_v2_atrous_pets.config放到了object_detection的文件夹里。 运行

python train.py --logtostderr --train_dir = training/ --pipeline_config_path = training/faster_rcnn_inception_resnet_v2_atrous_pets.config

我收到错误:

`
username@host:~/Documents/tensorflowModels/object_detection$ python train.py --logtostderr --train_dir = training/ --pipeline_config_path = training/faster_rcnn_inception_resnet_v2_atrous_pets.config
Traceback (most recent call last):
  File "train.py", line 198, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "train.py", line 143, in main
    model_config, train_config, input_config = get_configs_from_pipeline_file()
  File "train.py", line 103, in get_configs_from_pipeline_file
    text_format.Merge(f.read(), pipeline_config)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 118, in read
    self._preread_check()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 78, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/usr/local/lib/python2.7/dist-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.NotFoundError: =`

知道这个过程有什么问题吗?

总结一下我的评论:

  • 去掉等号前后的空格。空格导致 Tensorflow 的参数解析器(基于 argparse 模块)将 '=' 解析为参数,这显然是错误的。您可以在错误消息中看到这种混淆:

tensorflow.python.framework.errors_impl.NotFoundError: =`