项目场景:
项目相关背景:
问题描述
遇到的问题1:
KeyError: ‘bluegrass’ 不能识别某标签
遇到的问题2:
xml = etree.fromstring(xml_str)
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
解决方案:
遇到的问题1:
pascal_voc_classes.json中的标签修改为自己数据集的标签
一下为原数据集的标签-----》修改为自己的即可
{"aeroplane": 1,"bicycle": 2,"bird": 3,"boat": 4,"bottle": 5,"bus": 6,"car": 7,"cat": 8,"chair": 9,"cow": 10,"diningtable": 11,"dog": 12,"horse": 13,"motorbike": 14,"person": 15,"pottedplant": 16,"sheep": 17,"sofa": 18,"train": 19,"tvmonitor": 20
}
遇到的问题2:
是数据格式的问题,修改为utf-8的数据格式即可
下面是 原代码
。
xml = etree.fromstring(xml_str)
修改后
xml = etree.fromstring(xml_str.encode('utf-8'))