C4-W1-A2 _ syntax error in happyModel()

I don’t know what is the problem!
I am getting a SyntaxError when I run the happyModel()
Here’s what I use inside my model (here I put only the first two):

model = tf.keras.Sequential([
tfl.ZeroPadding2D(padding=3, input_shape=(64,64,3))
tfl.Conv2D(filters=32, kernel_size=(7,7), strides=1)

I have also tried:
tfl.Conv2D(32, 7, strides=1)

And this is the complete error given:
File “”, line 35
tfl.Conv2D(filters=32, kernel_size=(7,7), strides=1)
SyntaxError: invalid syntax

Would you please help me to find the problem?

The error is probably on the line before the Conv2D layer.
Maybe you’re missing a comma, or have one too many.

In the sequential model, you’re creating a python list of the layers.
So every layer you add has to be separated by commas.

Thanks TMosh for the help. What I understood is that the problem is with the line before Conv2D which is: tfl.ZeroPadding2D(padding=3), right?
The thing that I didn’t get is how to separate every layer by commas. Would you please give an example to make it more clear to me? Thanks.

Try using


And try installing Keras with pip before the code.

rather than tfl.
Thank you!

Thanks starboy. But it doesn’t work!

Thanks TMosh. I got the point with commas. It works now :slight_smile: