Skip to content

AttributeError: 'NoneType' object has no attribute 'text' #34

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

Open
huyi666r opened this issue Mar 21, 2024 · 1 comment
Open

AttributeError: 'NoneType' object has no attribute 'text' #34

huyi666r opened this issue Mar 21, 2024 · 1 comment

Comments

@huyi666r
Copy link

issue1

  • **OS:**win11

  • Error: Traceback (most recent call last):
    File "roLabelImg.py", line 1142, in openNextImg
    self.loadFile(filename)
    File "roLabelImg.py", line 933, in loadFile
    self.loadPascalXMLByFilename(xmlPath)
    File "roLabelImg.py", line 1287, in loadPascalXMLByFilename
    tVocParseReader = PascalVocReader(xmlPath)
    File "E:\dt\roLabelImg-master\libs\pascal_voc_io.py", line 207, in init
    self.parseXML()
    File "E:\dt\roLabelImg-master\libs\pascal_voc_io.py", line 264, in parseXML
    if typeItem.text == 'bndbox':
    AttributeError: 'NoneType' object has no attribute 'text'

@karantai
Copy link

Something has happened with the format of the .xml files. Now, there is a new format when labelling, which is slightly different that the previous one (for instance, there is a type attribute in the new format), so the code breaks. In order to fix it change the lines depicted in the printscreen:

Screenshot from 2024-07-23 15-48-20

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