kacpo1
kacpo1

Reputation: 565

Tensorflow object detection - error when creating TFRecord

I'm using this tutorial: https://towardsdatascience.com/custom-object-detection-using-tensorflow-from-scratch-e61da2e10087 I'm stuck on point 6 (Create TFRecord). When I try to run object_detection/dataset_tools/create_tf_record.py I receive error like

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

I'm using:

Windows 8.1

Python 3.6

Tensorflow 1.9.0

Protobuf 3.11.2

Upvotes: 0

Views: 407

Answers (1)

kacpo1
kacpo1

Reputation: 565

Problem is solved by making trimaps folder and copying all images (.jpg) to it with extension .png.

I don't know why this isn't present in tutorial.

Upvotes: 1

Related Questions