I noticed that sometimes during augmentation an image file cannot be saved:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/Augmentor/Pipeline.py", line 251, in _execute
images[i].save(os.path.join(augmentor_image.output_directory, save_name))
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2099, in save
fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: 'MyImageFile.jpg'
But then this problem leads to another issue:
File "/usr/local/lib/python3.8/dist-packages/Augmentor/Pipeline.py", line 370, in sample
self._execute(augmentor_image)
File "/usr/local/lib/python3.8/dist-packages/Augmentor/Pipeline.py", line 268, in _execute
print("Error writing %s, %s. Change save_format to PNG?" % (file_name, e.message))
AttributeError: 'FileNotFoundError' object has no attribute 'message'
The Exception object does not have a message member.
So maybe you want to change line 268 to something like this:
print(f"Error writing {file_name}, {str(e)}. Change save_format to PNG?")
I noticed that sometimes during augmentation an image file cannot be saved:
But then this problem leads to another issue:
The
Exception
object does not have amessage
member. So maybe you want to change line 268 to something like this:print(f"Error writing {file_name}, {str(e)}. Change save_format to PNG?")