You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(tf_gpu) C:\Tensorflow1\models\research\object_detection>python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
WARNING: Logging before flag parsing goes to stderr.
W0927 00:55:20.335181 15036 deprecation_wrapper.py:119] From generate_tfrecord.py:121: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0927 00:55:20.341163 15036 deprecation_wrapper.py:119] From generate_tfrecord.py:107: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.
W0927 00:55:20.512737 15036 deprecation_wrapper.py:119] From generate_tfrecord.py:66: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
Traceback (most recent call last):
File "generate_tfrecord.py", line 121, in
tf.app.run()
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\absl\app.py", line 300, in run
_run_main(main, args)
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "generate_tfrecord.py", line 112, in main
tf_example = create_tf_example(group, path)
File "generate_tfrecord.py", line 67, in create_tf_example
encoded_jpg = fid.read()
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 122, in read
self._preread_check()
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 84, in _preread_check
compat.as_bytes(self.__name), 1024 * 512)
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Tensorflow1\models\research\object_detection\images\train\img000000.jpg : The system cannot find the file specified.
; No such file or directory
Solution 1:
I have changed the xml to csv file by adding the .jpg extension.
I want to use it for my own dataset.
I am able to run the model for single class like
models/research/object_detection/images/train/class1
models/research/object_detection/images/test/class1
I want to extend it to my multi class dataset.
Folder structure:
models/research/object_detection/images/train/class1
models/research/object_detection/images/train/class2
models/research/object_detection/images/train/class3
Hello, I have followed the tensorflow object detection API installation by following the below demo
https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10.
I am getting this problem while running the line---
python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
Error:
(tf_gpu) C:\Tensorflow1\models\research\object_detection>python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
WARNING: Logging before flag parsing goes to stderr.
W0927 00:55:20.335181 15036 deprecation_wrapper.py:119] From generate_tfrecord.py:121: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0927 00:55:20.341163 15036 deprecation_wrapper.py:119] From generate_tfrecord.py:107: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.
W0927 00:55:20.512737 15036 deprecation_wrapper.py:119] From generate_tfrecord.py:66: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
Traceback (most recent call last):
File "generate_tfrecord.py", line 121, in
tf.app.run()
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\absl\app.py", line 300, in run
_run_main(main, args)
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "generate_tfrecord.py", line 112, in main
tf_example = create_tf_example(group, path)
File "generate_tfrecord.py", line 67, in create_tf_example
encoded_jpg = fid.read()
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 122, in read
self._preread_check()
File "C:\Users\Aditya\Anaconda3\envs\tf_gpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 84, in _preread_check
compat.as_bytes(self.__name), 1024 * 512)
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Tensorflow1\models\research\object_detection\images\train\img000000.jpg : The system cannot find the file specified.
; No such file or directory
Solution 1:
I have changed the xml to csv file by adding the .jpg extension.
I want to use it for my own dataset.
I am able to run the model for single class like
models/research/object_detection/images/train/class1
models/research/object_detection/images/test/class1
I want to extend it to my multi class dataset.
Folder structure:
models/research/object_detection/images/train/class1
models/research/object_detection/images/train/class2
models/research/object_detection/images/train/class3
models/research/object_detection/images/test/class1
models/research/object_detection/images/test/class2
models/research/object_detection/images/test/class3
train_labels.csv file contains
filename,width,height,class,xmin,ymin,xmax,ymax
img000000.jpg,640,480,auto,21,114,77,193
img000001.jpg,640,480,auto,332,10,504,229
img000000.jpg,640,480,bus,322,356,334,371
img000001.jpg,640,480,bus,341,357,351,370
img000002.jpg,5500,3667,car,2516,1933,2819,2422
Any help is much appreciated.
Thank you in advance .
The text was updated successfully, but these errors were encountered: