做自己的训练集时运行voc_annotation.py,报错'NoneType' object has no attribute 'text'

最近在学着用yoloV3,然后参照一些不错的帖子学习,这些我觉得好的帖子稍后再整理。

今天在尝试制作自己的训练集的时候,前面都顺顺利利,但是在运行voc_annotation.py时报错了,

Traceback (most recent call last):
  File "", line 1, in 
  File "E:\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "E:\PyCharm 2018.3.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:/yolov3/keras-yolo3-master/voc_annotation.py", line 31, in 
    convert_annotation(year, image_id, list_file)
  File "D:/yolov3/keras-yolo3-master/voc_annotation.py", line 15, in convert_annotation
    difficult = obj.find('Difficult').text
AttributeError: 'NoneType' object has no attribute 'text

查了一些帖子,最后在一篇帖子中看明白了错误的来源,就是这个,点这里看原帖,帖子中说的是标注的.XML文件里,文件部分下缺少,然后我看了下自己的.xml文件,标注集是学长给的,之前是在matlib中使用的,在这里根本用不了[摊手]做自己的训练集时运行voc_annotation.py,报错'NoneType' object has no attribute 'text'_第1张图片

你可能感兴趣的:(learn,tf)