Unable to open previously saved .xml file
- **OS: Mac
- **PyQt version: 5.15.1
- Python 3.8.6 Homebrew
Python crashes and this error appears when i "Open Dir > .xml file"
Traceback (most recent call last): File "labelimg.py", line 1367, in openFile self.loadFile(filename) File "labelimg.py", line 1065, in loadFile self.lineColor = QColor(*self.labelFile.lineColor) AttributeError: 'LabelFile' object has no attribute 'lineColor' zsh: abort python labelimg.py
Also having this issue when opening an annotation directly. #341 and #210 did not work for me either.
I opened up a debugger and the initialization call to labelFile does not do anything with the filename, so it's obvious why there's no lineColor attribute or imageData. I'm guessing this workflow hasn't been exercised recently, and most just open a directory?
Opening a directory doesn't seem to work in my case either, it reports no errors and displays nothing, though perhaps that belongs in another ticket. My pascal labels are by themselves, pointing to the images via the standard pascal path parameter.
see the script to change the file names in the XML files.link
Band-aid solution:
self.line_color = QColor(*self.label_file.lineColor) if hasattr(self.label_file, "lineColor") else DEFAULT_LINE_COLOR
self.fill_color = QColor(*self.label_file.fillColor) if hasattr(self.label_file, "fillColor") else DEFAULT_FILL_COLOR
…but yeah [still TODO:] need to cycle through the different colours and map them properly I think.