Models: During handling of the above exception, another exception occurred: TypeError: a bytes-like object is required, not 'str'

Created on 4 Mar 2018  路  4Comments  路  Source: tensorflow/models

python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config

INFO:tensorflow:Scale of 0 disables regularizer.
INFO:tensorflow:Scale of 0 disables regularizer.
WARNING:tensorflow:From /home/kaushal/tensorflow1/models/research/object_detection/trainer.py:228: 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 "/home/kaushal/tensorflow1/models/research/object_detection/utils/label_map_util.py", line 132, in load_labelmap
text_format.Merge(label_map_string, label_map)
File "/home/kaushal/anaconda3/envs/tensorflow1/lib/python3.6/site-packages/google/protobuf/text_format.py", line 533, in Merge
descriptor_pool=descriptor_pool)
File "/home/kaushal/anaconda3/envs/tensorflow1/lib/python3.6/site-packages/google/protobuf/text_format.py", line 587, in MergeLines
return parser.MergeLines(lines, message)
File "/home/kaushal/anaconda3/envs/tensorflow1/lib/python3.6/site-packages/google/protobuf/text_format.py", line 620, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/kaushal/anaconda3/envs/tensorflow1/lib/python3.6/site-packages/google/protobuf/text_format.py", line 635, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/kaushal/anaconda3/envs/tensorflow1/lib/python3.6/site-packages/google/protobuf/text_format.py", line 703, in _MergeField
(message_descriptor.full_name, name))
google.protobuf.text_format.ParseError: 2:1 : Message type "object_detection.protos.StringIntLabelMap" has no field named "def".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 167, in
tf.app.run()
File "/home/kaushal/anaconda3/envs/tensorflow1/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "train.py", line 163, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/kaushal/tensorflow1/models/research/object_detection/trainer.py", line 235, in train
train_config.prefetch_queue_capacity, data_augmentation_options)
File "/home/kaushal/tensorflow1/models/research/object_detection/trainer.py", line 59, in create_input_queue
tensor_dict = create_tensor_dict_fn()
File "train.py", line 120, in get_next
dataset_builder.build(config)).get_next()
File "/home/kaushal/tensorflow1/models/research/object_detection/builders/dataset_builder.py", line 138, in build
label_map_proto_file=label_map_proto_file)
File "/home/kaushal/tensorflow1/models/research/object_detection/data_decoders/tf_example_decoder.py", line 154, in __init__
use_display_name)
File "/home/kaushal/tensorflow1/models/research/object_detection/utils/label_map_util.py", line 149, in get_label_map_dict
label_map = load_labelmap(label_map_path)
File "/home/kaushal/tensorflow1/models/research/object_detection/utils/label_map_util.py", line 134, in load_labelmap
label_map.ParseFromString(label_map_string)
TypeError: a bytes-like object is required, not 'str'

Most helpful comment

I reinstalled the library from scratch on a fresh Ubuntu GNOME 16.04. It worked. (Silly method , I know).

All 4 comments

hi, how did you solved this?

I reinstalled the library from scratch on a fresh Ubuntu GNOME 16.04. It worked. (Silly method , I know).

Most importantly, every time I installed the library I got an error regarding 'dct_method'. There is a fix for that in another issue. I resolved it by removing a line of code in the file 'example_decoders.py'. I still don't know what that error means. And why do they included that line in the code, if we just have to remove it.

if any one know how to solve this plz tel us how搂?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamal4493 picture kamal4493  路  3Comments

Mostafaghelich picture Mostafaghelich  路  3Comments

frankkloster picture frankkloster  路  3Comments

mbenami picture mbenami  路  3Comments

sun9700 picture sun9700  路  3Comments