I want to use multiple images as input of the network. And I want to add Conv2D layers, something like that:
from tensorflow.keras.layers import *
from tensorflow.keras.models import Sequential
model = Sequential([
Input(shape=(1, 128, 128, 1)),
Conv2D(32, 3),
Flatten(),
])
But this code raises the error: Input 0 of layer conv2d_40 is incompatible with the layer: expected ndim=4, found ndim=5. Full shape received: [None, 1, 128, 128, 1]
But the code below is working fine:
model = Sequential([
Input(shape=(1, 512, 512, 1)),
Dense(32),
Flatten(),
])
I know, I can add multiple Input layers, but I want to know is there a way to make it like this?
I mean I want to use data of input shape [NUMBER_OF_IMAGES, WIDTH, HEIGHT, N_CHANNELS]
And NUMBER_OF_IMAGES is not amount of all images. This is an amount for current input