【问题标题】:tensorflow object detection API error to traintensorflow对象检测API错误训练
【发布时间】:2018-04-20 07:35:07
【问题描述】:

我正在使用 UBUNTU 16.04 并且我有安装程序 tensorflow,现在我正在尝试安装对象检测 API。 我已经从 git 克隆了 API,所以它给了我一个包含以下树的存储库:models/research/ 从研究仓库中,我遵循了官方 git 的所有步骤,我可以运行测试。然后我做了:

`sudo python setup.py install`

我还从源代码编译了 protoc 编译器以获得最新版本:3.5.1

我已经收集了我的数据并创建了 tf 记录并将它们放入数据存储库中。 我将配置文件放在培训存储库中。 我将数据、训练和模型文件存储库复制到 models/researches/object-detection/

然后我尝试运行 train.py 脚本以使用我自己的数据进行训练,但我收到以下错误,我真的迷路了,也许我做错了什么。有人知道吗?

`python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_coco.config 
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
Traceback (most recent call last):
  File "train.py", line 167, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "train.py", line 92, in main
    FLAGS.pipeline_config_path)
  File "/home/jimmy/Desktop/ObjectDetecAPI/models/research/object_detection/utils/config_util.py", line 92, in get_configs_from_pipeline_file
    proto_str = f.read()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 120, in read
    self._preread_check()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 80, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: training/ssd_mobilenet_v1_coco.config; No such file or directory
'
   `/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type.
  from ._conv import register_converters as _register_converters
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
Traceback (most recent call last):
  File "train.py", line 167, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "train.py", line 92, in main
    FLAGS.pipeline_config_path)
  File "/home/jimmy/Desktop/ObjectDetecAPI/models/research/object_detection/utils/config_util.py", line 92, in get_configs_from_pipeline_file
    proto_str = f.read()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 120, in read
    self._preread_check()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 80, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: training/ssd_mobilenet_v1_coco.config; No such file or directory`

但我很确定我有一个培训存储库,里面有一个配置文件。

【问题讨论】:

    标签: python tensorflow deep-learning object-detection


    【解决方案1】:

    基于以下回溯:

    tensorflow.python.framework.errors_impl.NotFoundError: training/ssd_mobilenet_v1_coco.config; No such file or directory`
    

    您的配置文件的以下路径似乎定义不正确。

    --pipeline_config_path=training/ssd_mobilenet_v1_coco.config
    

    我建议您在尝试训练模型之前使用绝对文件路径和/或仔细检查您是否设置了正确的 PYTHONPATH 变量。可能只是路径或 PYTHONPATH 中的拼写错误。

    Ubuntu:在使用 TensorFlow 对象检测 API 之前,请参阅以下设置 PYTHONPATH 变量的说明: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md#add-libraries-to-pythonpath

    【讨论】:

      猜你喜欢
      • 2018-01-01
      • 2018-05-15
      • 1970-01-01
      • 2018-04-18
      • 2018-12-28
      • 1970-01-01
      • 1970-01-01
      • 2019-06-28
      • 1970-01-01
      相关资源
      最近更新 更多