Python Tensorflow对象检测-创建TFRecord时出错

Python Tensorflow对象检测-创建TFRecord时出错,python,tensorflow,Python,Tensorflow,我正在使用本教程:我被第6点(创建TFRecord)卡住了。当我尝试运行object\u detection/dataset\u tools/create\u tf\u record.py时,我收到如下错误 C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\ python\framework\dtypes.py:523: FutureWarning: Passing (type, 1)

我正在使用本教程:我被第6点(创建TFRecord)卡住了。当我尝试运行
object\u detection/dataset\u tools/create\u tf\u record.py
时,我收到如下错误

C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\
python\framework\dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be underst
ood as (type, (1,)) / '(1,)type'.
 _np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\
python\framework\dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be underst
ood as (type, (1,)) / '(1,)type'.
 _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\
python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be underst
ood as (type, (1,)) / '(1,)type'.
 _np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\
python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be underst
ood as (type, (1,)) / '(1,)type'.
 _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\
python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be underst
ood as (type, (1,)) / '(1,)type'.
 _np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\
python\framework\dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a
synonym of type is deprecated; in a future version of numpy, it will be underst
ood as (type, (1,)) / '(1,)type'.
 np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\object_dete
ction\utils\dataset_util.py:75: FutureWarning: The behavior of this method will
change in future versions. Use specific 'len(elem)' or 'elem is not None' test i
nstead.
 if not xml:
Traceback (most recent call last):
 File "research/object_detection/dataset_tools/create_tf_record.py", line 309,
in <module>
   tf.app.run()
 File "C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\ten
sorflow\python\platform\app.py", line 125, in run
   _sys.exit(main(argv))
 File "research/object_detection/dataset_tools/create_tf_record.py", line 296,
in main
   mask_type=FLAGS.mask_type)
 File "research/object_detection/dataset_tools/create_tf_record.py", line 251,
in create_tf_record
   mask_type=mask_type)
 File "research/object_detection/dataset_tools/create_tf_record.py", line 110,
in dict_to_tf_example
   encoded_mask_png = fid.read()
 File "C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\ten
sorflow\python\lib\io\file_io.py", line 125, in read
   self._preread_check()
 File "C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\ten
sorflow\python\lib\io\file_io.py", line 85, in _preread_check
   compat.as_bytes(self.__name), 1024 * 512, status)
 File "C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site-packages\ten
sorflow\python\framework\errors_impl.py", line 519, in __exit__
   c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile faile
d to Create/Open: annotations\trimaps\3.png : The system cannot find the path specified
C:\Users\Ja\AppData\Local\Programs\Python\Python36\lib\site packages\tensorflow\
python\framework\dtypes.py:523:FutureWarning:将(type,1)或“1type”作为
类型的同义词已弃用;在numpy的未来版本中,它将被理解
作为(类型,(1,)/“(1,)类型”的ood。
_np_qint8=np.dtype([(“qint8”,np.int8,1)])
C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\tensorflow\
python\framework\dtypes.py:524:FutureWarning:将(type,1)或“1type”作为
类型的同义词已弃用;在numpy的未来版本中,它将被理解
作为(类型,(1,)/“(1,)类型”的ood。
_np_quint8=np.dtype([(“quint8”,np.uint8,1)])
C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\tensorflow\
python\framework\dtypes.py:525:FutureWarning:将(type,1)或“1type”作为
类型的同义词已弃用;在numpy的未来版本中,它将被理解
作为(类型,(1,)/“(1,)类型”的ood。
_np_qint16=np.dtype([(“qint16”,np.int16,1)])
C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\tensorflow\
python\framework\dtypes.py:526:FutureWarning:将(type,1)或“1type”作为
类型的同义词已弃用;在numpy的未来版本中,它将被理解
作为(类型,(1,)/“(1,)类型”的ood。
_np_quint16=np.dtype([(“quint16”,np.uint16,1)])
C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\tensorflow\
python\framework\dtypes.py:527:FutureWarning:将(type,1)或“1type”作为
类型的同义词已弃用;在numpy的未来版本中,它将被理解
作为(类型,(1,)/“(1,)类型”的ood。
_np_qint32=np.dtype([(“qint32”,np.int32,1)])
C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\tensorflow\
python\framework\dtypes.py:532:FutureWarning:将(type,1)或“1type”作为
类型的同义词已弃用;在numpy的未来版本中,它将被理解
作为(类型,(1,)/“(1,)类型”的ood。
np_resource=np.dtype([(“resource”,np.ubyte,1)])
C:\Users\Ja\AppData\Local\Programs\Python\36\lib\site packages\object\u dete
Action\utils\dataset\u util.py:75:FutureWarning:此方法的行为将
在未来版本中进行更改。使用特定的“len(elem)”或“elem不是无”测试i
恩斯特德。
如果不是xml:
回溯(最近一次呼叫最后一次):
文件“research/object\u detection/dataset\u tools/create\u tf\u record.py”,第309行,
在里面
tf.app.run()
文件“C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\ten
sorflow\python\platform\app.py”,第125行,运行中
_系统出口(主(argv))
文件“research/object\u detection/dataset\u tools/create\u tf\u record.py”,第296行,
大体上
掩码类型=标志。掩码类型)
文件“research/object\u detection/dataset\u tools/create\u tf\u record.py”,第251行,
在create_tf_记录中
遮罩类型=遮罩类型)
文件“research/object\u detection/dataset\u tools/create\u tf\u record.py”,第110行,
在dict_to_tf_示例中
encoded_mask_png=fid.read()
文件“C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\ten
sorflow\python\lib\io\file_io.py”,第125行,已读
self.\u预读\u检查()
文件“C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\ten
sorflow\python\lib\io\file\u io.py”,第85行,在预读检查中
兼容字节(自身名称),1024*512,状态)
文件“C:\Users\Ja\AppData\Local\Programs\Python36\lib\site packages\ten
sorflow\python\framework\errors\u impl.py”,第519行,在退出中__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors\u impl.NotFoundError:NewRandomAccessFile失败
d创建/打开:annotations\trimaps\3.png:系统找不到指定的路径
我正在使用:

Windows 8.1

Python 3.6

Tensorflow 1.9.0


Protobuf 3.11.2

通过创建trimaps文件夹并将所有图像(
.jpg
)复制到扩展名为
.png
的文件夹中来解决此问题


我不知道为什么教程中没有出现这种情况。

查看错误的最后一行
notations\trimaps\3.png:系统找不到指定的路径
,请确保此文件位于同一路径