models icon indicating copy to clipboard operation
models copied to clipboard

Error: "tensorflow.python.framework.errors_impl.FailedPreconditionError: ." in object detection

Open deatherving opened this issue 9 years ago • 23 comments

I just modified "PATH_TO_BE_CONFIGURED" parts in the config file faster_rcnn_inception_resnet_v2_atrous_pets.config

However, I got an error below, so weird:

This is the details of the error msg: Traceback (most recent call last): File "object_detection/train.py", line 198, in tf.app.run() File "/data/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "object_detection/train.py", line 145, in main model_config, train_config, input_config = get_configs_from_multiple_files() File "object_detection/train.py", line 127, in get_configs_from_multiple_files text_format.Merge(f.read(), train_config) File "/data/anaconda2/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 125, in read pywrap_tensorflow.ReadFromStream(self._read_buf, length, status)) File "/data/anaconda2/lib/python2.7/contextlib.py", line 24, in exit self.gen.next() File "/data/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.FailedPreconditionError: .

What is this "." in the error msg refers to? Anyone got the same error?

deatherving avatar Jul 14 '17 10:07 deatherving

Did you manage to solve it?

nachogutierrez avatar Jul 14 '17 22:07 nachogutierrez

I did. It's because I typed a "tab" in the command line.

deatherving avatar Jul 15 '17 06:07 deatherving

DId you find a solution?

odedfis avatar Jul 24 '17 16:07 odedfis

@odedfis Yes. It is simply because of an invisible "tab" in the command line. Check the command line first.

deatherving avatar Jul 26 '17 07:07 deatherving

@deatherving Got exactly the same errr. I checked my command line carefully but did not find any mistyped "tab"s. Did you make it your own accidentally by mistyping? Thanks a lot!

yhmybzc avatar Sep 25 '17 13:09 yhmybzc

@yhmybzc I did. It's just a mistyping. Check the command line very carefully and you'll find it.

deatherving avatar Sep 26 '17 01:09 deatherving

Could you write down all the typings you wrote?

Euun avatar Oct 18 '17 10:10 Euun

@Euun Try this one. python object_detection/train.py --logtostderr --train_dir TF_API_OD/models/model/train --pipeline_config_path TF_API_OD/models/model/faster_rcnn_inception_resnet_v2_atrous_pets.config

deatherving avatar Oct 19 '17 06:10 deatherving

Traceback (most recent call last): File "E:/project3/retrain2.py", line 1263, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run _sys.exit(main(argv)) File "E:/project3/retrain2.py", line 947, in main module_spec = hub.load_module_spec(FLAGS.tfhub_module) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_hub\native_module.py", line 103, in load_module_spec module_def_proto.ParseFromString(f.read()) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 120, in read self._preread_check() File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 80, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 519, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Users\user\AppData\Local\Temp\tfhub_modules\11d9faf945d073033780fd924b2b09ff42155763\tfhub_module.pb : The system cannot find the file specified. ; No such file or directory

rakeshkumarsamantara avatar Jun 04 '18 07:06 rakeshkumarsamantara

how to slove this problem

rakeshkumarsamantara avatar Jun 04 '18 07:06 rakeshkumarsamantara

@rakeshkumarsamantara did you solve your problem? now, I got the same......

ViktorijaV avatar Jun 13 '18 13:06 ViktorijaV

Yes i got the solution of this problem. Please send me full image of the error.

On 13-Jun-2018 6:36 pm, "Viktorija Velinovska" [email protected] wrote:

@rakeshkumarsamantara https://github.com/rakeshkumarsamantara did you solve your problem? now, I got the same......

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1957#issuecomment-396929854, or mute the thread https://github.com/notifications/unsubscribe-auth/AkVIioj0fv_SPSUbScQAg3Ic88wUhfz_ks5t8Q5mgaJpZM4OYFK9 .

rakeshkumarsamantara avatar Jun 13 '18 13:06 rakeshkumarsamantara

If the error like Create/Open: C:\Users\user\AppData\Local\Temp\tfhub_modules\11d9faf945d073033780fd924b2b09ff42155763\tfhub_module.pb : The system cannot find the file specified. ; No such file or director

rakeshkumarsamantara avatar Jun 13 '18 13:06 rakeshkumarsamantara

Delete the 11d9faf945d073033780fd924b2b09ff42155763 folder . Then the problem is solved.

rakeshkumarsamantara avatar Jun 13 '18 13:06 rakeshkumarsamantara

@rakeshkumarsamantara here is the error:

INFO:tensorflow:Using C:\Users\user\AppData\Local\Temp\tfhub_modules to cache modules. Traceback (most recent call last): File "retrain.py", line 1333, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run _sys.exit(main(argv)) File "retrain.py", line 1017, in main module_spec = hub.load_module_spec(FLAGS.tfhub_module) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_hub\native_module.py", line 103, in load_module_spec module_def_proto.ParseFromString(f.read()) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 120, in read self._preread_check() File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 80, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 519, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: C:\Users\user\AppData\Local\Temp\tfhub_modules\11d9faf945d073033780fd924b2b09ff42155763\tfhub_module.pb : The system cannot find the file specified. ; No such file or directory

ViktorijaV avatar Jun 13 '18 13:06 ViktorijaV

@rakeshkumarsamantara Thank you so much . It's workiiing :))))

ViktorijaV avatar Jun 13 '18 13:06 ViktorijaV

You most welcome

On 13-Jun-2018 6:55 pm, "Viktorija Velinovska" [email protected] wrote:

@rakeshkumarsamantara https://github.com/rakeshkumarsamantara Thank you so much . It's workiiing :))))

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/1957#issuecomment-396935881, or mute the thread https://github.com/notifications/unsubscribe-auth/AkVIigc0eNF5raqp8Y5vzP1lSuxPzJF4ks5t8RLcgaJpZM4OYFK9 .

rakeshkumarsamantara avatar Jun 13 '18 13:06 rakeshkumarsamantara

can any one send me the solution : [email protected]

DeepNeurons avatar Jun 27 '19 23:06 DeepNeurons

(tensorflow_cpu) c:\tensorflowf\model\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config WARNING:tensorflow:From C:\Users\shubham jha\Anaconda3\miniconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\platform\app.py:125: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. WARNING:tensorflow:From C:\tensorflowf\model\research\object_detection\legacy\trainer.py:266: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version. Instructions for updating: Please switch to tf.train.create_global_step Traceback (most recent call last): File "train.py", line 184, in tf.app.run() File "C:\Users\shubham jha\Anaconda3\miniconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "C:\Users\shubham jha\Anaconda3\miniconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\util\deprecation.py", line 250, in new_func return func(*args, **kwargs) File "train.py", line 180, in main graph_hook_fn=graph_rewriter_fn) File "C:\tensorflowf\model\research\object_detection\legacy\trainer.py", line 280, in train train_config.prefetch_queue_capacity, data_augmentation_options) File "C:\tensorflowf\model\research\object_detection\legacy\trainer.py", line 59, in create_input_queue tensor_dict = create_tensor_dict_fn() File "train.py", line 121, in get_next dataset_builder.build(config)).get_next() File "C:\tensorflowf\model\research\object_detection\builders\dataset_builder.py", line 130, in build num_additional_channels=input_reader_config.num_additional_channels) File "C:\tensorflowf\model\research\object_detection\data_decoders\tf_example_decoder.py", line 314, in init default_value=''), File "C:\tensorflowf\model\research\object_detection\data_decoders\tf_example_decoder.py", line 59, in init label_map_proto_file, use_display_name=False) File "C:\tensorflowf\model\research\object_detection\utils\label_map_util.py", line 164, in get_label_map_dict label_map = load_labelmap(label_map_path) File "C:\tensorflowf\model\research\object_detection\utils\label_map_util.py", line 133, in load_labelmap label_map_string = fid.read() File "C:\Users\shubham jha\Anaconda3\miniconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 125, in read self._preread_check() File "C:\Users\shubham jha\Anaconda3\miniconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 85, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "C:\Users\shubham jha\Anaconda3\miniconda\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 519, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: ~/tensorflowf/model/research/object_detection/training/labelmap.pbtxt : The system cannot find the path specified. ; No such process

please anyone help me with this....i tried a lot

Innovator07 avatar Jun 30 '19 09:06 Innovator07

I was getting error - tensorflow.python.framework.errors_impl.FailedPreconditionError: models/my_efficientdet_d1_coco17_tpu-32/checkpoint.tmpffd9e7f72eaf4c43989a3ec212154023; Is a directory

My pretrained model and checkpoints were in directory pre-trained-models/efficientdet_d1_coco17_tpu-32/checkpoint Path I was supplying to training file: --model_dir=models/my_efficientdet_d1_coco17_tpu-32

pipeline.config file was in model_dir and had fine_tune_checkpoint: "pre-trained-models/efficientdet_d1_coco17_tpu-32/checkpoint/ckpt-0"

Clearly, I was not supplying models/my_efficientdet_d1_coco17_tpu-32/checkpoint.tmpffd9e7f72eaf4c43989a3ec212154023 anywhere explicitly for checkpoints... Now the problem was that model_dir mentioned above had other folders named checkpoint , saved_model and some ckpt file which for some reason were being picked up implicitly during training process...

Action: I just emptied the model_dir i.e. deleted folders named checkpoint , saved_model etc...

And re ran the code, and the above error was solved.

Hope it helps

fateh288 avatar Oct 02 '20 19:10 fateh288