Sj03rd
Sj03rd

Reputation: 71

How to convert RGBA files to RGB

I am doing a tutorial on making a CNN for image-recognition. I have downloaded a bunch of pictures from the internet per class. I gave them all the extension .jpg.

When I am trying to train my model I get the error-message:

Userwarning: Palette images with Transparency expressed in bytes should be converted to RGBA images

Can I fix this or did I use the wrong type of pictures? It seems that when I make a model without the imagedatagenerator that it is no problem, but if I do use it than I get this error message.

Hope somebody can point me in the right direction!

Upvotes: 1

Views: 2903

Answers (1)

Mahesh
Mahesh

Reputation: 163

My guess would be that the way you are reading the input images needs correction.

Usually, TensorFlow models consume images in numpy nd array format. Try refining the image reading pipeline and feed images as numpy nd array. Give a look at this domo

Upvotes: 1

Related Questions