C4 W4 A2: Convolutional_model maxpooling

THIS IS MY CODE:

Z1=tf.keras.layers.Conv2D(8,(4,4),strides=(1,1), padding= 'same')(input_img)

A1= tf.keras.layers.ReLU()(Z1)

P1= tf.keras.layers.MaxPooling2D((8, 8), strides= (8,8), name='max_pool', padding='same')(A1)

Z2=tf.keras.layers.Conv2D(16,(2,2),strides=(1,1), padding= 'same')(input_img)

A2=tf.keras.layers.ReLU()(Z2)

P2=tf.keras.layers.MaxPooling2D((4, 4), strides= (4,4), name='max_pool', padding='same')(A2)

F=tf.keras.layers.Flatten()(input_img)

outputs = tf.keras.layers.Dense(units=6, activation='softmax') (input_img)

THIS IS THE ERROR:

I just dont know which argument I am passing wrong. or did i get the size wrong anywhere? CHECKED MULTIPLE TIMES, THE KERNEL AND STRIDE SIZES SEEM TO BE ALRIGHT.

In “Z2 = …” and “F = …” and “outputs = …”, you’re not passing the correct data arguments.

1 Like

Thank you very much for your reply, I previously tried the right ones but for some reason it didn’t work -_- just needed a fresh start. thank you.