Course 4 week 1 - TensorFlow syntax


The documentation for tensorflow is quite unclear and I don’t understand how I am messing up the syntax. I have the amount of filters, the kernal_size and the stride.

File "<ipython-input-21-43ec9dfaf315>", line 35
    tf.keras.layers.Conv2D(32,(7,7), stride = 1)
SyntaxError: invalid syntax

I assume that you are working on Exercise 1, Sequential Model.
The Sequential model is to create a series of functions as a “list”. Please see this.

model = tf.keras.Sequential([

It starts with a square bracket to create a list. So, you need to add “,” (comma) at the end of function to create a list. In the above case, it is most likely caused by a missing comma in the previous line. Please double check.

1 Like