I put in all the tfl.ZeroPadding2D, tfl.Conv2D etc and I keep getting syntax errors. I’ve tried different orders, different parameters etc and I always get a syntax error on the second line no matter what the first line nor the second line is.Is there a good example of how a model is put together I can look at to learn from? This is the first time I am using Tensorflow Kertas except for the small amount in Machine Learning.
The Sequential model is built essentially as a python list.
You put all of the layer information inside one set of square brackets, with commas separating the info for each layer.
Please post an image showing your syntax errors.
You’re given the definition of the list here:
model = tf.keras.Sequential([
That has the opening square bracket.
You fill in the layers, separated by commas, like:
tfl.ZeroPadding2D(...),
… is where you fill in the parameters and end with a comma
Then you’re given this to end the list:
])
That’s the closing square bracket.
OK thanks. I will try shortly. If I still need help, I will post a picture. I was not putting in commas. It makes sense.
They don’t give us a lot of help in the documentation in the notebook. The Sequential API is just the first case. You’ll next run into the Functional API. If you want a more complete introduction to these facilities, it’s worth having a look at this thread on Discourse.
That fixed it. Did not know about the commas. Thank you!