Tensorflow Training Error

Hello, whenever I try to run my model using the following command

python model_main_tf2.py --pipeline_config_path=ssd_efficientdet_d0_512x512_coco17_tpu-8.config --model_dir=training --alsologtostderr

I get the following errors

WARNING:tensorflow:From C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py:563: StrategyBase.experimental_distribute_datasets_from_function (from tensorflow.python.distribute.distribute_lib) is deprecated and will be removed in a future version.
Instructions for updating:
rename to distribute_datasets_from_function
W1127 19:32:21.850916 28108 deprecation.py:350] From C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py:563: StrategyBase.experimental_distribute_datasets_from_function (from tensorflow.python.distribute.distribute_lib) is deprecated and will be removed in a future version.
Instructions for updating:
rename to distribute_datasets_from_function
Traceback (most recent call last):
File “C:\Users\theho.DESKTOP-N88HVJI\PycharmProjects\FinalAIProject\models\research\object_detection\model_main_tf2.py”, line 114, in
tf.compat.v1.app.run()
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\platform\app.py”, line 36, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\absl\app.py”, line 308, in run
_run_main(main, args)
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\absl\app.py”, line 254, in _run_main
sys.exit(main(argv))
File “C:\Users\theho.DESKTOP-N88HVJI\PycharmProjects\FinalAIProject\models\research\object_detection\model_main_tf2.py”, line 105, in main
model_lib_v2.train_loop(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py”, line 563, in train_loop
train_input = strategy.experimental_distribute_datasets_from_function(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\util\deprecation.py”, line 357, in new_func
return func(*args, **kwargs)
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\distribute_lib.py”, line 1198, in experimental_distribute_datasets_from_function
return self.distribute_datasets_from_function(dataset_fn, options)
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\distribute_lib.py”, line 1189, in distribute_datasets_from_function
return self._extended._distribute_datasets_from_function( # pylint: disable=protected-access
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\mirrored_strategy.py”, line 593, in _distribute_datasets_from_function
return input_util.get_distributed_datasets_from_function(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\input_util.py”, line 132, in get_distributed_datasets_from_function
return input_lib.DistributedDatasetsFromFunction(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\input_lib.py”, line 1372, in init
self.build()
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\input_lib.py”, line 1393, in build
_create_datasets_from_function_with_input_context(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\distribute\input_lib.py”, line 1875, in _create_datasets_from_function_with_input_context
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py”, line 554, in train_dataset_fn
train_input = inputs.train_input(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\inputs.py”, line 908, in train_input
dataset = INPUT_BUILDER_UTIL_MAP[‘dataset_build’](
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\builders\dataset_builder.py”, line 209, in build
decoder = decoder_builder.build(input_reader_config)
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\builders\decoder_builder.py”, line 51, in build
decoder = tf_example_decoder.TfExampleDecoder(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py”, line 458, in init
_ClassTensorHandler(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py”, line 92, in init
name_to_id = label_map_util.get_label_map_dict(
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\utils\label_map_util.py”, line 211, in get_label_map_dict
label_map = load_labelmap(label_map_path_or_proto)
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\object_detection\utils\label_map_util.py”, line 172, in load_labelmap
label_map_string = fid.read()
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\lib\io\file_io.py”, line 114, in read
self._preread_check()
File “C:\ProgramData\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\lib\io\file_io.py”, line 76, in _preread_check
self._read_buf = _pywrap_file_io.BufferedInputStream(
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: models/research/object_detection/labelmap.pbtxt : The system cannot find the path specified.
; No such process

So, I’ve checked my labelmap path and it is correct, I’ve tried using model_main.py and I get the same error. I’ve tried reinstalling python, tensorflow, and the object detection api within my environment. Does anyone know what to do here?

Any help would be greatly appreciated

Hi @Jackie,

Sorry for the delayed response. The error seems it’s a path issue. Could you please confirm and check that your label_map.txt file is in correct path. One chance either you can try to give the absolute path to your pbtxt file or keep your label_map.pbtxt in this path and run the model again.

Thank You