I’ll try to point out something that stuck out in this assignment without actually sharing anything of value for completing the assignment.
The assignment instructs you to use a ZeroPadding2D layer with an input shape of 64 x 64 x 3. This seems to be the intention of the person who wrote the assignment:
## ZeroPadding2D with padding 3, input shape of 64 x 64 x 3
tfl.ZeroPadding2D(..., input_shape=(64, 64, 3)),
However, this is not actually documented in the ZeroPadding2D documentation, and is a bit of a nasty subtle gotcha to just casually have sitting there with no emphasis to be cautious of it, or where to look in the Keras documentation to solve it.
It seems like it might not even be idiomatic Keras usage - from reading the Keras documentations, it seems there is an Input layer that is intended to be used for setting the shape:
# Define input shape of 64 x 64 x 3
tfl.Input(shape=(64, 64, 3)),
## ZeroPadding2D with padding 3, input shape of 64 x 64 x 3
tfl.ZeroPadding2D(...),
The assignment is probably fine as is - but it seems like an unnecessary use of time to have people getting stuck on such a trivial piece of configuration rather than on the actual ConvNet itself. Adding the Input layer to the assignment documentation, or otherwise suggesting how to configure the input shape would be a useful improvement, I feel.
I absolutely agree with you and I was really getting quite anxious about it. In the official documentation, only two arguments are allowed in the ZeroPadding2Dlayer (padding and data_format). I finally found some non-official description of the function, where the “parameters” also included inputShape. I was excited to use it (inputShape = (64, 64, 3)) only to find out that it also does not work (it should be “input_shape”, not “inputShape”). (Originally, I was putting it into an extra set of parentheses after the ZeroPadding2D which seemed to be the way it was done on the internet.)
Even though I like a bit of challenge in the assignments, I felt we were really left hanging. We had never seen the syntax before (tensorFlow intro in the previous course did not use this style of syntax) and the official and unofficial documentation was of no help.
Just adding a note that I got stuck on this as well. After taking a guess and just adding the parameter to the ZeroPadding2D layer, when running the code locally with TensorFlow version 2.18.0, it works, but I get the following warning in the console:
UserWarning: Do not pass an input_shape/input_dim argument to a layer. When using Sequential models, prefer using an Input(shape) object.
That seems to indicate that the approach shown in the OP is the preferred way of defining the input shape.
Only somewhat related, but maybe not worth a separate topic, the summary function that’s defined in test_utils.py fails with recent versions of TensorFlow. Instead of layer.output_shape, it needs to use layer.output.shape.