Week Assignment 2 Exercise 1

Hello All,
I get this error for Assignment 2 Exercise 1 and I dont understand what the error is. Please note, I have the input layer which provides input image of size (64,64,3)

Can anyone please help me ?

Thank you,

Please see the 1st layer inside your sequential model. It’s invoking the __call__ method. Do remember that there’s a difference between sequential and functional ways of creating a model. In the sequential way, specifying layer objects in a list is sufficient. In functional style, it’s important to create a layer and then call it with the previous layer as input.

Yeah, Thanks for pointing that out. I removed the input to the zero-padding layer. However, I had issue with the way I added input layer. Initially I used tf.keras.Input and with tfl.InputLayer the issue is fixed, and All tests passed.

Thank you

You’re welcome.
You don’t need an Input layer. It’s sufficient to specify input_shape to the 1st layer of a sequential model.

They don’t really give us that much info on how to use the Sequential and Functional Models here. You should also have a look at this thread from ai_curious which goes into a lot more depth about these APIs.