pprp / voc2007_for_yolo_torch

:punch: Prepare VOC format datasets for ultralytics/yolov3 & yolov5
GNU General Public License v3.0
196 stars 57 forks source link

voc_label出现问题 #6

Open KingorBegger opened 3 years ago

KingorBegger commented 3 years ago

大神creat_all中调用voc_label.py代码时在此处 tree=ET.parse(in_file) root = tree.getroot() size = root.find('size') w = int(size.find('width').text) h = int(size.find('height').text) for obj in root.iter('object'): 出现问题'NoneTyep'object has no attribute 'text‘ 上述代码最后一行改为 for obj in size.iter('object'):可以跑通,结果就是txt文件存在,但是内容全为空是我不能这么改么--

pprp commented 3 years ago

NoneType说明没有找到对象,检查一下文件路径