Hi,
I was using label img successfully until I recently pulled down updates (it had been a while). Now it can't open an image directories, and I get the error:
"Make sure /Users/elizabeth/Pictures/GoPro/2017-07-31/HERO5 Black 1/Time Lapse 1/G0016365.JPG is a valid image file."
Tried removing and reinstalling everything.
Help?
Hi @Elizabethcase ,
I am not sure about the root cause. Could you help me to do a test?
Move that image to another folder without space or special characters, then try to open the image again.
If solved, the problem might be about decoding the image path in the wrong format.
Hi @tzutalin,
Ah sorry, yes. I've tried with different images/file formats/locations. Unfortunately I'm getting the same error for all of them. I can't open any image directly and it throws the same error for every directory.
Anything else I might be able to try?
Hi @Elizabethcase ,
That's wired. So far, I cannot know the cause. Adding a log to the below lines is the alternative way to get more insights:
https://github.com/tzutalin/labelImg/blob/f4d87a9951b067d5719f5ffaeed211b5329d502b/labelImg.py#L901
https://github.com/tzutalin/labelImg/blob/f4d87a9951b067d5719f5ffaeed211b5329d502b/labelImg.py#L907
How do you add a log?
@Elizabethcase ,
You can add a log by using print() or log library. Using print() is easier.
In the meantime, you can try to download and reinstall again to see if the issue will happen or not.
@Elizabethcase ,
Do you resolve it?
Hi @tzutalin thanks for building this awesome tool. I'm getting the same error as @Elizabethcase
OSX Sierra
Python 2.7 and pyqt 4.11.4
I followed the setup outline here https://github.com/tzutalin/labelImg/issues/141

I looked at the lines you provided above. Not sure why the error description doesn't show in the error dialog box like it's implied in the code block below.
except LabelFileError as e:
self.errorMessage(u'Error opening file',
(u"<p><b>%s</b></p>"
u"<p>Make sure <i>%s</i> is a valid label file.")
% (e, unicodeFilePath))
@bobhaffner just below that is the corresponding error
Not sure if you're doing this in a conda environment but for whatever reason (that I can't figure out), I got labelimg working with pyqt5 and python 3 only outside the environment. Previously, I always ran it within an environment. Thinking it must be a path thing because some searching shows that qt4 was bugging out with jpgs for a while, but I'm not fluent enough to suss out the exact solution.
@tzutalin I did, but I honestly don't know why doing it inside vs. outside a conda environment with all the required packages installed made a difference.
Thanks for your help & responsiveness!
Hi @Elizabethcase I don't think I follow you on the error thing. I'm thinking it should appear on the line that's currently blank between Error opening file and Make sure...
I am using a conda env. That's interesting. Come to think of it, I did read a blog post that mentioned the same thing about jpegs
I came across the same problem within conda environment.
I'm using OSX Sierra Python 2.7 and pyqt4. After some search, I found this thread. Basically, the problem lies in pyqt4 and they are not going to add support to jpeg.
So my solution is just switching to python 3 with pyqt5. Hope it helps.
So my solution is just switching to python 3 with pyqt5. Hope it helps.
Same here @xinario. I was able to install everything thru conda
Looks like this issue has been resolved. If not, please feel free to reopen.
Thanks,
-Vlad
Hello, I'm getting the same error as @bobhaffner and @Elizabethcase now.
In case of me, labelImg doesn't work well even if I switch versions to python3 and pyqt5.
銉籑ac OS
銉籔ython 3.7.3
銉籶yqt5
How can I solve the error ?
@Stern-Hayat Here are my versions if that helps
python 3.4.5
pyqt5 5.4.1
Most helpful comment
@tzutalin I did, but I honestly don't know why doing it inside vs. outside a conda environment with all the required packages installed made a difference.
Thanks for your help & responsiveness!