Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voc_label出现问题 #6

Open
KingorBegger opened this issue Jan 14, 2021 · 1 comment
Open

voc_label出现问题 #6

KingorBegger opened this issue Jan 14, 2021 · 1 comment

Comments

@KingorBegger
Copy link

大神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
Copy link
Owner

pprp commented Jan 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants