如何在 Tensorflow 对象检测中为自定义标签创建 tfrecord?

how to create tfrecord for custom labels in Tensorflow object detection?

我正在尝试使用 tensorflow 对象检测 API 进行自定义图像分类。从 labelimg 收集图像并创建 csv 后,我尝试生成 TfRecord。但是每次我 运行 程序它 returns 错误

    C:\>python generate_tfrecord.py --csv_input=data/train
_labels.csv  --output_path=data/train.record
Traceback (most recent call last):
  File "generate_tfrecord.py", line 101, in <module>
    tf.app.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\ap
p.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 "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file
_io.py", line 118, in read
    self._preread_check()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file
_io.py", line 78, in _preread_check
    compat.as_bytes(self.__name), 1024 * 512, status)
  File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 89, in __exit__
    next(self.gen)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\e
rrors_impl.py", line 466, in raise_exception_on_not_ok_status
    pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile faile
d to Create/Open: C:\image.jpg : The system cannot find the file specified.

我有所有jpg格式的图片,并且图片在指定的文件夹中。

C:\image.jpg : The system cannot find the file specified.

文件中的路径必须是完整路径。