KeyError: 'face'
来源:6-21 TensorFlow-ssd 模型训练-实操(1)

N1ghtV0yager
2021-01-08
有face还是报错
/home/chlts/models/research/object_detection/utils/dataset_util.py:79: FutureWarning: The behavior of this method will change in future versions. Use specific ‘len(elem)’ or ‘elem is not None’ test instead.
if not xml:
Traceback (most recent call last):
File “object_detection/dataset_tools/create_face_tf_record.py”, line 185, in
tf.app.run()
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py”, line 125, in run
_sys.exit(main(argv))
File “object_detection/dataset_tools/create_face_tf_record.py”, line 178, in main
FLAGS.ignore_difficult_instances)
File “object_detection/dataset_tools/create_face_tf_record.py”, line 120, in dict_to_tf_example
classes.append(label_map_dict[obj[‘name’]])
KeyError: ‘face’
master/research/object_detection/data/face_label_map.pbtxt :
item {
name: 'face'
id: 1
display_name: 'face'
}
4回答
-
慕田峪7505890
2021-12-03
你们应该是没改这里
flags.DEFINE_string('label_map_path', '../data/face_label_map.pbtxt', 'Path to label map proto')
而是用了保留了原文件中的通用物体检测的文件
10 -
会写代码的好厨师
2021-12-14
master/research/object_detection/data/face_label_map.pbtxt
注意这个文件,需要和数据打包时候定义的类别保持对齐00 -
幕布斯0585347
2021-05-01
我也遇到这个问题,请问解决了吗
00 -
会写代码的好厨师
2021-01-23
'face' --》 用了中文字符?
00
相似问题