Unicode decode error when training the model

im following this tutorial: https://www.youtube.com/watch?v=8ktcGQ-XreQ&t=2037s
everything seems good untill i start training the model:
(tf2) PS C:\Users\user\TF2\models\research\object_detection> python model_main_tf2.py --pipeline_config_path==ssd_efficientdet_d0_512x512_coco17_tpu-8.config --mod
el_dir==training --alsologtostderr
C:\Users\user\anaconda3\envs\tf2\lib\site-packages\tensorflow_addons\utils\tfa_eol_msg.py:23: UserWarning:

TensorFlow Addons (TFA) has ended development and introduction of new features.
TFA has entered a minimal maintenance and release mode until a planned end of life in May 2024.
Please modify downstream libraries to take dependencies from other repositories in our TensorFlow community (e.g. Keras, Keras-CV, and Keras-NLP).

For more information see: TensorFlow Addons Wind Down · Issue #2807 · tensorflow/addons · GitHub

C:\Users\user\anaconda3\envs\tf2\lib\site-packages\tensorflow_addons\utils\ensure_tf_install.py:53: UserWarning: Tensorflow Addons supports using Python ops for all
Tensorflow versions above or equal to 2.12.0 and strictly below 2.15.0 (nightly versions are not supported).
The versions of TensorFlow you are currently using is 2.10.1 and is not supported.
Some things might work, some things might not.
If you were to encounter a bug, do not file an issue.
If you want to make sure you’re using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons’s version.
You can find the compatibility matrix in TensorFlow Addon’s readme:

2024-01-05 11:48:21.692796: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)
to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-01-05 11:48:23.051167: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1616] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 2780 MB memory:
→ device: 0, name: NVIDIA GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1
INFO:tensorflow:Using MirroredStrategy with devices (‘/job:localhost/replica:0/task:0/device:GPU:0’,)
I0105 11:48:23.608268 19932 mirrored_strategy.py:374] Using MirroredStrategy with devices (‘/job:localhost/replica:0/task:0/device:GPU:0’,)
Traceback (most recent call last):
File “C:\Users\user\TF2\models\research\object_detection\model_main_tf2.py”, line 114, in
File “C:\Users\user\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:\Users\user\anaconda3\envs\tf2\lib\site-packages\absl\app.py”, line 308, in run
_run_main(main, args)
File “C:\Users\user\anaconda3\envs\tf2\lib\site-packages\absl\app.py”, line 254, in _run_main
File “C:\Users\user\TF2\models\research\object_detection\model_main_tf2.py”, line 105, in main
File “C:\Users\user\anaconda3\envs\tf2\lib\site-packages\object_detection\model_lib_v2.py”, line 505, in train_loop
configs = get_configs_from_pipeline_file(
File “C:\Users\user\anaconda3\envs\tf2\lib\site-packages\object_detection\utils\config_util.py”, line 138, in get_configs_from_pipeline_file
proto_str = f.read()
File “C:\Users\user\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\lib\io\file_io.py”, line 115, in read
File “C:\Users\user\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\lib\io\file_io.py”, line 77, in _preread_check
self._read_buf = _pywrap_file_io.BufferedInputStream(
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe1 in position 112: invalid continuation byte

can someone please help?

Hi @matecuca,

I strongly suggest utilizing the TensorFlow Official Model Garden to circumvent issues related to outdated code commonly found in research codebases. Unlike the research repositories, the Official Model Garden is consistently updated and aligned with the latest changes in TensorFlow and other libraries and there are lot of API’s are available that you can define a training experiment using Python commands in the TensorFlow Model library.We have developed several Notebook examples like object detection that illustrate how to train models from the ground up.

I hope this helps.


Will try that, thank you for the help!

1 Like