TannerGilbert/Tensorflow-Object-Detection-API-train-custom-Mask-R-CNN-model

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 73: invalid continuation byte

x12901 opened this issue · 2 comments

I'm having trouble running your source code.
python: 3.6.5 64bit
tensorflow: 2.3.0
Keras : 2.4.3

D:\cwge\models\research\object_detection>python model_main_tf2.py --pipeline_config_path=D:/cwge/models/training/mask_rcnn_inception_resnet_v2_1024x1024_coco17_gpu-8.config --model_dir=D:/cwge/models/training --alsologtostderr
2020-09-16 12:38:26.950458: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2020-09-16 12:38:26.962405: 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.
2020-09-16 12:38:32.908862: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
2020-09-16 12:38:32.919711: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2020-09-16 12:38:33.019091: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:02:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.582GHz coreCount: 28 deviceMemorySize: 11.00GiB deviceMemoryBandwidth: 451.17GiB/s
2020-09-16 12:38:33.038528: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 1 with properties:
pciBusID: 0000:03:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.582GHz coreCount: 28 deviceMemorySize: 11.00GiB deviceMemoryBandwidth: 451.17GiB/s
2020-09-16 12:38:33.066568: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 2 with properties:
pciBusID: 0000:82:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.582GHz coreCount: 28 deviceMemorySize: 11.00GiB deviceMemoryBandwidth: 451.17GiB/s
2020-09-16 12:38:33.095532: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 3 with properties:
pciBusID: 0000:83:00.0 name: GeForce GTX 1080 Ti computeCapability: 6.1
coreClock: 1.582GHz coreCount: 28 deviceMemorySize: 11.00GiB deviceMemoryBandwidth: 451.17GiB/s
2020-09-16 12:38:33.115073: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2020-09-16 12:38:33.131405: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2020-09-16 12:38:33.166001: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cufft64_10.dll
2020-09-16 12:38:33.174169: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2020-09-16 12:38:33.196464: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cusolver64_10.dll
2020-09-16 12:38:33.208752: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2020-09-16 12:38:33.222092: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudnn64_8.dll
2020-09-16 12:38:33.238184: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2020-09-16 12:38:33.268078: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-09-16 12:38:33.306098: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-09-16 12:38:33.315884: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
2020-09-16 12:38:33.326425: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
WARNING:tensorflow:There are non-GPU devices in tf.distribute.Strategy, not using nccl allreduce.
W0916 12:38:33.338405 31380 cross_device_ops.py:1176] There are non-GPU devices in tf.distribute.Strategy, not using nccl allreduce.
INFO:tensorflow:Using MirroredStrategy with devices ('/job:localhost/replica:0/task:0/device:CPU:0',)
I0916 12:38:33.339406 31380 mirrored_strategy.py:347] Using MirroredStrategy with devices ('/job:localhost/replica:0/task:0/device:CPU:0',)
INFO:tensorflow:Maybe overwriting train_steps: None
I0916 12:38:33.351401 31380 config_util.py:552] Maybe overwriting train_steps: None
INFO:tensorflow:Maybe overwriting use_bfloat16: False
I0916 12:38:33.352406 31380 config_util.py:552] Maybe overwriting use_bfloat16: False
Traceback (most recent call last):
File "model_main_tf2.py", line 113, in
tf.compat.v1.app.run()
File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\site-packages\absl\app.py", line 300, in run
_run_main(main, args)
File "C:\ProgramData\Anaconda3\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "model_main_tf2.py", line 110, in main
record_summaries=FLAGS.record_summaries)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\model_lib_v2.py", line 526, in train_loop
train_dataset_fn)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\distribute\distribute_lib.py", line 1145, in experimental_distribute_datasets_from_function
dataset_fn, options)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\distribute\mirrored_strategy.py", line 525, in _experimental_distribute_datasets_from_function
self._container_strategy())
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\distribute\input_lib.py", line 136, in get_distributed_datasets_from_function
strategy)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\distribute\input_lib.py", line 1158, in init
dataset_fn))
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\distribute\input_lib.py", line 1751, in _create_datasets_per_worker_with_input_context
dataset = dataset_fn(ctx)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\model_lib_v2.py", line 521, in train_dataset_fn
input_context=input_context)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\inputs.py", line 838, in train_input
reduce_to_frame_fn=reduce_to_frame_fn)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\builders\dataset_builder.py", line 148, in build
decoder = decoder_builder.build(input_reader_config)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\builders\decoder_builder.py", line 63, in build
load_track_id=input_reader_config.load_track_id)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\data_decoders\tf_example_decoder.py", line 385, in init
default_value=''),
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\data_decoders\tf_example_decoder.py", line 89, in init
label_map_proto_file, use_display_name=False)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\utils\label_map_util.py", line 189, in get_label_map_dict
label_map = load_labelmap(label_map_path_or_proto)
File "C:\ProgramData\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\utils\label_map_util.py", line 156, in load_labelmap
label_map_string = fid.read(-1)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 117, 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.path_to_str(self.__name), 1024 * 512)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 73: invalid continuation byte

Possibly fixed by tensorflow/models#9225
Thanks, that didn't work for me. I solved the problem by modifying config_util.py.Now it's ready for training.
with open(pipeline_config_path, "r",encoding='utf-8') as f: proto_str =f.read()