models icon indicating copy to clipboard operation
models copied to clipboard

Label_Map: a bytes-like object is required, not 'str'

Open AlvanChow opened this issue 8 years ago • 1 comments

Attempting to run the train.py file like so:

python train.py --logtostderr --train_dir=./models/train --pipeline_config_path=ssd_inception_v2_coco.config

However, I end up with this error:

File "/Users/../models/research/object_detection/utils/label_map_util.py", line 137, in load_labelmap label_map.ParseFromString(label_map_string) TypeError: a bytes-like object is required, not 'str'

My class_labels.pbtxt is in the following format: item { id: 11 name: 'Fixed-wing Aircraft' } item { id: 12 name: 'Small Aircraft' }

Do I need to change it to a byte-like object somehow?

(Using Tensorflow version 1.8)

AlvanChow avatar May 08 '18 05:05 AlvanChow

item { name: "Fixed-wing Aircraft" id: 11 display_name: "Fixed-wing Aircraft" }

Name needs to be first

AlvanChow avatar May 08 '18 17:05 AlvanChow