地铁客流检测训练问题记录
一 报错:
File "/home/jz/py-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 183, in _load_pascal_annotation
tree = ET.parse(filename)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
tree.parse(source, parser)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 657, in parse
self._root = parser.close()
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1665, in close
self._raiseerror(v)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1517, in _raiseerror
raise err
ParseError: no element found: line 1, column 0
显然是xml标签文件解析出错。(网上查的结果都和APP应用以及网页相关,参考价值寥寥)
简单打开了几个文件,发现格式和内容没有问题。初步判断是个别文件没有按照我的说明文档进行正确修正。
简单写了个代码将所有文件解析一遍,证明判断正确:有空文件,还有格式内容不对的文件。该批次文件按说明文档再次修改即可。