raccoon_dataset
raccoon_dataset copied to clipboard
error when generate tfrecord
when I run generate_tfrecord. I met the problem below:
Traceback (most recent call last):
File "generate_tfrecord.py", line 99, in
check spaces in the input/output path, it's telling you that the path doesn't exist.
@thriskel Thank u for your remind.
D:\Mainproject\models-master\research\object_detection>python generate_tfrecord.py
Traceback (most recent call last):
File "generate_tfrecord.py", line 99, in
can someone tell where and what has to be changed ? Thank you.. @BraveGump @thriskel
same error as @BraveGump did you fix it?
I ran into the same issue and resolved it by:
-
Make sure to check out tensorflow models and set your environment variable PYTHONPATH correctly: export PYTHONPATH=$PYTHONPATH:<path_to_tensorflow>/models/research/:<path_to_tensorflow>/models/research/slim
-
Run the script with proper parameters/flags: python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path = train.record --image_dir=images/
(tfgpu) D:\models\research\object_detection>python generate_TFR.py --csv_input=d
ata/test0.csv --output_path=train.record
Traceback (most recent call last):
File "generate_TFR.py", line 112, in
How can I fix it?
(tfgpu) D:\models\research\object_detection>python generate_TFR.py --csv_input=d ata/test0.csv --output_path=train.record Traceback (most recent call last): File "generate_TFR.py", line 112, in tf.app.run() File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\platform\app. py", line 125, in run _sys.exit(main(argv)) File "generate_TFR.py", line 103, in main tf_example = create_tf_example(group, path) File "generate_TFR.py", line 58, in create_tf_example encoded_jpg = fid.read() File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\lib\io\file_i o.py", line 125, in read self._preread_check() File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\lib\io\file_i o.py", line 85, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\framework\err ors_impl.py", line 528, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: NewRandomAccessFil e failed to Create/Open: D:\models\research\object_detection\images2 rain\tra in_0.png : \udcceļ\udcfe\udcc3\udcfb\udca1\udca2Ŀ¼\udcc3\udcfb\udcbb\udcf2\udcbe \udced\udcb1\udcea\udcd3�\udcb2\udcbb\udcd5\udcfdȷ\udca1\udca3 ; Unknown error
How can I fix it?
(tfgpu) D:\models\research\object_detection>python generate_TFR.py --csv_input=d ata/test0.csv --output_path=train.record Traceback (most recent call last): File "generate_TFR.py", line 112, in tf.app.run() File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\platform\app. py", line 125, in run _sys.exit(main(argv)) File "generate_TFR.py", line 103, in main tf_example = create_tf_example(group, path) File "generate_TFR.py", line 58, in create_tf_example encoded_jpg = fid.read() File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\lib\io\file_i o.py", line 125, in read self._preread_check() File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\lib\io\file_i o.py", line 85, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "D:\Anaconda\envs\tfgpu\lib\site-packages\tensorflow\python\framework\err ors_impl.py", line 528, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: NewRandomAccessFil e failed to Create/Open: D:\models\research\object_detection\images2 rain\tra in_0.png : \udcceļ\udcfe\udcc3\udcfb\udca1\udca2Ŀ¼\udcc3\udcfb\udcbb\udcf2\udcbe \udced\udcb1\udcea\udcd3�\udcb2\udcbb\udcd5\udcfdȷ\udca1\udca3 ; Unknown error
How can I fix it?
em,it's my problem...I have fix it.
(tfgpu)D:\ models \ research \ object_detection> python generate_TFR.py --csv_input = d ata / test0.csv --output_path = train.record Traceback(最近一次调用最后一次): 文件“generate_TFR.py”,第112行,在 tf.app.run() 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ platform \ app.py ”,第125行,在运行 sys.exit中(main(argv) ) 文件“generate_TFR.py”,第103行,在主 tf_example = create_tf_example(group,path) 文件“generate_TFR.py”,第58行,在create_tf_example encoded_jpg = fid.read() 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ lib \ io \ file_i o.py“,第125行,读取 self.preread_check() 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ lib \ io \ file_i o.py”,第85行,在_preread_check compat.as_bytes(self . name),1024 * 512,status ) 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ framework \ err ors_impl.py”,第528行,在退出 c_api.TF_GetCode(self.status.status)中) tensorflow.python。 framework.errors_impl.InvalidArgumentError:NewRandomAccessFil e无法创建/打开:D:\ models \ research \ object_detection \ images2 rain \ tra in_0.png:\udcceļ\ udcfe \ udcc3 \ udcfb \ udca1 \udca2Ŀ¼\ udcc3 \ udcfb \ udcbb \ udcf2 \ udcbe \ udced \ udcb1 \ udcea \udcd3 \ udcb2 \ udcbb \ udcd5 \udcfdȷ\ udca1 \ udca3 ; 未知错误 我该如何解决?
(tfgpu)D:\ models \ research \ object_detection> python generate_TFR.py --csv_input = d ata / test0.csv --output_path = train.record Traceback(最近一次调用最后一次): 文件“generate_TFR.py”,第112行,在 tf.app.run() 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ platform \ app.py ”,第125行,在运行 sys.exit中(main(argv) ) 文件“generate_TFR.py”,第103行,在主 tf_example = create_tf_example(group,path) 文件“generate_TFR.py”,第58行,在create_tf_example encoded_jpg = fid.read() 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ lib \ io \ file_i o.py“,第125行,读取 self.preread_check() 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ lib \ io \ file_i o.py”,第85行,在_preread_check compat.as_bytes(self . name),1024 * 512,status ) 文件“D:\ Anaconda \ envs \ tfgpu \ lib \ site-packages \ tensorflow \ python \ framework \ err ors_impl.py”,第528行,在退出 c_api.TF_GetCode(self.status.status)中) tensorflow.python。 framework.errors_impl.InvalidArgumentError:NewRandomAccessFil e无法创建/打开:D:\ models \ research \ object_detection \ images2 rain \ tra in_0.png:\udcceļ\ udcfe \ udcc3 \ udcfb \ udca1 \udca2Ŀ¼\ udcc3 \ udcfb \ udcbb \ udcf2 \ udcbe \ udced \ udcb1 \ udcea \udcd3 \ udcb2 \ udcbb \ udcd5 \udcfdȷ\ udca1 \ udca3 ; 未知错误 我该如何解决?
嗯,这是我的问题......我已经解决了。
How did you solve it?Thank you!(请问你是怎样解决的,谢谢!)
I ran into the same issue and resolved it by:
- Make sure to check out tensorflow models and set your environment variable PYTHONPATH correctly: export PYTHONPATH=$PYTHONPATH:<path_to_tensorflow>/models/research/:<path_to_tensorflow>/models/research/slim
- Run the script with proper parameters/flags: python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path = train.record --image_dir=images/
Thank you pc2005. I had the same issue and your instructions helped me.
try to run using command line : python generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=train.record --image_dir=./images
For windows you need to run this code in Research folder
on cmd: SET PYTHONPATH=%cd%;%cd%\slim
vinay@vinay-Lenovo-G50-70:~/models/research/object_detection$ python generate_tfrecord.py --csv_input=image/train_labels.csv --image_dir=image/train --output_path=train.record WARNING: Logging before flag parsing goes to stderr. W0812 19:07:55.100965 140015557965632 deprecation_wrapper.py:119] From generate_tfrecord.py:106: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0812 19:07:55.103269 140015557965632 deprecation_wrapper.py:119] From generate_tfrecord.py:92: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.
W0812 19:07:55.232243 140015557965632 deprecation_wrapper.py:119] From generate_tfrecord.py:51: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
Traceback (most recent call last):
File "generate_tfrecord.py", line 106, in
i am getting this error while executing tf_record.py
vinay@vinay-Lenovo-G50-70:~/models/research/object_detection$ python generate_tfrecord.py --csv_input=image/train_labels.csv --image_dir=image/train --output_path=train.record WARNING: Logging before flag parsing goes to stderr. W0812 19:07:55.100965 140015557965632 deprecation_wrapper.py:119] From generate_tfrecord.py:106: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0812 19:07:55.103269 140015557965632 deprecation_wrapper.py:119] From generate_tfrecord.py:92: The name tf.python_io.TFRecordWriter is deprecated. Please use tf.io.TFRecordWriter instead.
W0812 19:07:55.232243 140015557965632 deprecation_wrapper.py:119] From generate_tfrecord.py:51: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.
Traceback (most recent call last): File "generate_tfrecord.py", line 106, in tf.app.run() File "/home/vinay/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/vinay/.local/lib/python2.7/site-packages/absl/app.py", line 300, in run _run_main(main, args) File "/home/vinay/.local/lib/python2.7/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "generate_tfrecord.py", line 97, in main tf_example = create_tf_example(group, path) File "generate_tfrecord.py", line 86, in create_tf_example 'image/object/class/label': dataset_util.int64_list_feature(classes), File "/usr/local/lib/python2.7/dist-packages/object_detection-0.1-py2.7.egg/object_detection/utils/dataset_util.py", line 30, in int64_list_feature return tf.train.Feature(int64_list=tf.train.Int64List(value=value)) TypeError: None has type NoneType, but expected one of: int, long
i am getting this error while executing tf_record.py
same error @vinayslone1995 did you get it rectified??
C:\Mayur\Facemask>python generate_tfrecord.py [-x images] [-l annotations] [-o records] [-i images] [-c data]
2020-09-11 13:51:29.341914: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-09-11 13:51:29.345204: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "generate_tfrecord.py", line 120, in
I am trying to read a tfrecord file and get this error NewRandomAccessFile failed to Create/Open: 'path to file'<TFRecordDatasetV2 shapes: (), types: tf.string> : The filename, directory name, or volume label syntax is incorrect. ; no protocol option
The path to the tfrecord file seems to be correct, can anyone help?