Hello, I made an image recognition model in python using keras, this is the input shape:
input_shape=(3, 32, 32)
The model itself works fine, but when I try to pass any other image that is not from the dataset I get this error:
ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 3 but received input with shape (None, 32, 32, 1)
I do reshape the image, but can not figure out why I am getting that error and failing every pass
image = load_img("image.jpeg", grayscale="false", color_mode="rgb", target_size=(32, 32))
image = img_to_array(image)
image = image.reshape(3, 32, 32, 1)
image = image.astype('float32')
image = image / 255.0
How do I go about solving this issue and reshaping the image correctly?
Thanks in advance!