0

define model using CNN Model

model=Sequential()
model.add(Conv1D(filters=256, kernel_size=2, activation='relu', input_shape=(32, 32, 3)))
model.add(MaxPooling1D(pool_size=2))
model.add(Flatten())
model.add(Dense(1000, activation='relu'))
model.add(Dense(500, activation='relu'))
model.add(Dense(200, activation='relu'))
model.add(Dense(1))
model.compile(optimizer='adam', loss='mse')

I tried to run above given code but i got this the error [model.add(MaxPooling1D(pool_size=2))]

ValueError: Input 0 of layer "max_pooling1d_2" is incompatible with the layer: expected ndim=3, found ndim=4. Full shape received: (None, 32, 31, 256)

If you give me a solution for this error it will be helpful to me to run this code. thank you

I Need right suggestion to sort out the above given error

0 Answers0