mdbloice / Augmentor

Image augmentation library in Python for machine learning.
https://augmentor.readthedocs.io/en/stable
MIT License
5.08k stars 866 forks source link

'OSError' object has no attribute 'message' #196

Open gpavanb-osi opened 5 years ago

gpavanb-osi commented 5 years ago

Python : 3.7.4 OS : Mac OSX 10.14.3 Bug : 'OSError' object has no attribute 'message' when using sample method Solution : message is deprecated in latest Python version. One must use msg while catching such exceptions

mdbloice commented 5 years ago

Hi @gpavanb-osi, thanks for making the issue. What code are you running to make this error appear?

gpavanb-osi commented 5 years ago

Hi @mdbloice, I'm running p.sample, which seems to be working without issues for a certain subset of my data set and fails with the above error for others. Unfortunately, I cannot share the dataset here.

Interestingly, the error disappears once I specify a save_format to PNG in my case.

mdbloice commented 5 years ago

Ok, well I am guessing that there is something up with the images that causes an exception, which then triggers a further exception as the keyword message is not understood by Python 3.7. Perhaps using PNG as the save format is the best workaround for now, I will work on replacing message with msg for compatibility with later versions of Python and maybe that fixes your issue (but I doubt that, as the message/msg issue is probably not the root cause of the error you are experiencing). Sorry I can't be of any more help.

gpavanb-osi commented 5 years ago

No worries. There is a workaround for the time being.

mdbloice commented 5 years ago

Ok fine, in a next version I will fix the message/msg problem, maybe that sorts it out, maybe not. Anyway, thanks for making the issue. Marcus.

hanss0n commented 3 years ago

No worries. There is a workaround for the time being.

What is the workaround?