Tensorflow.python.framework.errors_impl.NotFoundError

时间:2018-03-15 16:50:08

标签: python-3.x tensorflow

尝试构建我自己的自定义数据集时,直到我尝试运行以下代码时才转到tf_records:

python3 generate_tfrecord.py --csv_input=data/train_labels.csv  --output_path=data/train.record

为我的自定义对象检测构建tr_records我收到以下错误:

Traceback (most recent call last):
  File "generate_tfrecord.py", line 101, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "generate_tfrecord.py", line 92, in main
    tf_example = create_tf_example(group, path)
  File "generate_tfrecord.py", line 47, in create_tf_example
    encoded_jpg = fid.read()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/file_io.py", line 115, in read
    self._preread_check()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/file_io.py", line 75, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "/usr/lib/python3.5/contextlib.py", line 66, in __exit__
    next(self.gen)
  File "/usr/local/lib/python3.5/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: /home/david/models/research/object_detection/images/000000004765.jpg

1 个答案:

答案 0 :(得分:-1)

我不是专家,但我认为

--csv_input=data/train_labels.csv

实际应该是:

--csv_input="C:/admin/directories_in_between/data/train_labels.csv"
如果您要查找的文件位于您的计算机上,则

或其他内容。

尝试更改两者并查看是否有效。