Week 1: Assignment 2: Conv2D giving syntax error

i have an error regarding tfl.Conv2D, which says ‘invalid syntax’ regarding tfl.Conv2D, does anyone can help me how I can fix it?

here is the code that I have used:

tfl.Conv2D(32,(7,7),strides=(1,1))

Umm… When you do
´´´print(tfl)´´´
, what does it say?

Have you checked the docpage for Conv2D? How many of those parameters are positional versus named? Also are you doing the Sequential API or the Functional API here? If the latter, that statement gives a function. If the former, then you need a comma at the end, right?

The other generic thing to check for is the usual missing close paren on the previous line.

The import cell defines that as an alias for tensorflow.keras.layers.

Thanks for your reply. I am doing sequential API and after seeing this post I just remember that i forgot to put the comma at the end of each line.

Now my code works fine

2 Likes