As the error suggests, Flatten layer does not need ‘shape’ on input. A flatten layer flattens the input to a one dimensional vector, based on the shape of channel-height-width of the image (batch direction is NOT flattened). So, an image of size (1, 64, 10) (1 channel, 64 pixels height and 10 width) is converted to a vector with the shape (1, 640). Follow this help page on TensorFlow: tf.keras.layers.Flatten | TensorFlow Core v2.4.1 for more details. This operation only changes the shape of the tensor - it doesn’t add more weights to the model
Perhaps a more complete answer for this question is:
The exercise instructions (and the Keras documentation) don’t clearly say that every layer needs to have a (…) parameter after it, not just the Conv2D and Dense layers.
ok i think these notebooks are not that helpful for the best.
for anyone not understanding the comments here,(you will not benefit from them,but once you are done ,they’ll feel not as obscure)to note:
func(params)(input)
and although func api deals with non linearity, theres no non
linearity happening in this assignm.