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

Created on 8 May 2018  路  1Comment  路  Source: tensorflow/models

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)

Most helpful comment

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

Name needs to be first

>All comments

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

Name needs to be first

Was this page helpful?
0 / 5 - 0 ratings