Image channel error while training CNN model

21 Views Asked by At

I get the following error when trying to train a CNN model:

InvalidArgumentError: Graph execution error:

Detected at node decode_image/DecodeImage defined at (most recent call last):
<stack traces unavailable>
Number of channels inherent in the image must be 1, 3 or 4, was 2
     [[{{node decode_image/DecodeImage}}]]
     [[IteratorGetNext]] [Op:__inference_train_function_1598]

The dataset I am working on is Cats and Dogs classification dataset from Kaggle. I defined the data like this:

path=r'C:\Users\berid\python\cats and dogs\PetImages'
data=tf.keras.utils.image_dataset_from_directory(path)

Any suggestion will be appreciated.

0

There are 0 best solutions below