EdjeElectronics / TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

How to train a TensorFlow Object Detection Classifier for multiple object detection on Windows
Apache License 2.0
2.92k stars 1.3k forks source link

google.protobuf.text_format.ParseError: 151:25 #277

Open Maxalop opened 5 years ago

Maxalop commented 5 years ago

Windows 10. TensorFlow (cpu) installed from git clone. Python version 3.6.8

I have got the same error. (tensorflow_cpu) C:\Users\Divin\tensorflow\workspace\training_demo>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_coco.config

WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0. For more information, please see:

https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md https://github.com/tensorflow/addons If you depend on functionality not listed there, please file an issue. WARNING:tensorflow:From C:\Users\Divin\Anaconda3\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. Traceback (most recent call last): File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 1291, in _ConsumeSingleByteString result = text_encoding.CUnescape(text[1:-1]) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_encoding.py", line 105, in CUnescape .decode('unicode_escape') UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 184, in tf.app.run() File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow\python\util\deprecation.py", line 324, in new_func return func(*args, **kwargs) File "train.py", line 93, in main FLAGS.pipeline_config_path) File "C:\Users\Divin\tensorflow\models\research\object_detection\utils\config_util.py", line 98, in get_configs_from_pipeline_file text_format.Merge(proto_str, pipeline_config) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 536, in Merge descriptor_pool=descriptor_pool) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 590, in MergeLines return parser.MergeLines(lines, message) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 623, in MergeLines self._ParseOrMerge(lines, message) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 638, in _ParseOrMerge self._MergeField(tokenizer, message) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 837, in _MergeMessageField self._MergeField(tokenizer, sub_message) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 888, in _MergeScalarField value = tokenizer.ConsumeString() File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 1251, in ConsumeString the_bytes = self.ConsumeByteString() File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 1266, in ConsumeByteString the_list = [self._ConsumeSingleByteString()] File "C:\Users\Divin\Anaconda3\envs\tensorflow_cpu\lib\site-packages\google\protobuf\text_format.py", line 1293, in _ConsumeSingleByteString raise self.ParseError(str(e)) google.protobuf.text_format.ParseError: 151:25 : 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Rajamohanreddyai commented 5 years ago

Hi, check this link https://youtu.be/nZUxoHPFf4w

Hello, it is very clear the path you specified was not available or else wrong, in the faster_rcnn_inception_v2_pets.config file.

use forward shlash ( / ) for train.record path, test.record path and labelmap.pbtxt and finetune checkpoint path, and verify it should be full path like

C:/Users/Divin/tensorflow/workspace/training/labelmap.pbtxt

use forward shlash ( / )