Week 1 - Assignment 2 - Excercise 1

Hello, I have read the document of The Sequential model and tf.keras.layers.ZeroPadding2D model but it seems like there is a problem with the input parameters, there is no batch. I changed to None or 1 but nothing happened. Any advice please?


Looking at the error “'tuple object has no attribute ‘lower’” and looking at line 192 “data_format = value.lower()” indicates that the issue is that your input for data_format, which is a tuple, doesn’t have .lower(), which is suggestive of a string (doing .lower() on a string makes it all lowercase)

Indeed, looking at the Keras documentation for ZeroPadding2D and reading the “Arguments” section shows that data_format is supposed to be a string indicating whether the dimension telling you how many channels there are is the first dimension or the last. Since it looks like yours are at the end, you don’t need that argument at all, though you could put “channels_last.”

As this is the first layer of your sequence model, you need to specify what is the input, i.e, input\_shape. You do not need to touch data\_format for this exercise. If you look at the description of Exercise 1, you find that the parameter to be set is (64,64,3).

ZeroPadding2D: padding 3, input shape 64 x 64 x 3