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

ValueError: image has wrong mode #171

Open ghost opened 5 years ago

ghost commented 5 years ago

I am getting this error ValueError: image has wrong mode

Roosh27 commented 4 years ago

@mdbloice Could you please help on this? I am facing the same issue.

joys8998 commented 4 years ago

I had the same error @mdbloice how can we solve?

Thanks

sri-dhurkesh commented 4 years ago

Actually I also had the same error. At first, I added so many methods to the pipeline p. like this

import Augmentor p = Augmentor.Pipeline('/kaggle/working/final1_resized_0','/kaggle/working/final1_augment') p.rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10) p.zoom(probability=0.5, min_factor=1.1, max_factor=1.5) p.flip_left_right(probabilty=0.2) p.rotate_random_90(probability=0.6) p.flip_top_bottom(probability=0.5) p.sample(2500)

after that i'll just check it by using some basic augmentation methods (code given below) like zoom and rotate only.

import Augmentor p = Augmentor.Pipeline('/kaggle/working/final1_resized_0','/kaggle/working/final1_augment') p.rotate(probability=0.7, max_left_rotation=10, max_right_rotation=10) p.zoom(probability=0.5, min_factor=1.1, max_factor=1.5) p.sample(2500)

It works for me. Till I don't know how it works for me. I hope this will helpful for u in some way. May be due to some inconsistency in methods that we added in our pipeline

NBCS1 commented 3 years ago

I hope you found the issue. For posterity, for me it was because I was trying to import .tif files. I converted them to .png and worked!

xuanzhiliu commented 2 years ago

Hi,I found that when I used methods like: p.random_color or p.random_brightness the error will occured but other methods worked very well,I don't know how to solve this issue