DSL 4 Week 1 assignment 2

Hi I am getting this error, I’m having trouble understanding the dimensions.

ypeError Traceback (most recent call last)
in
----> 1 happy_model = happyModel()
2 # Print a summary for each layer
3 for layer in summary(happy_model):
4 print(layer)
5

in happyModel()
32
33 # YOUR CODE STARTS HERE
—> 34 tf.keras.layers.ZeroPadding2D(padding=(3)(X_train)),
35 tf.keras.layers.Conv2D(32, (7, 7), strides = (1, 1)),
36 tf.keras.layers.BatchNormalization(axis=3),

TypeError: ‘int’ object is not callable

In happyModel(), you’re using the Sequential model to create a list of the layers you want to use.
You don’t have to pass any data arguments, like (X_train).
And putting the 3 inside parenthesis is also wrong. That’s why it says “int object is not callable”.

The instructions tell you to use padding=3 and input_shape=(64,64,3).

1 Like

X_train is a global variable, you should not use it inside the happyModel() function.

How to add input_shape parameter to Padding Layer ?

Just try inside the parenthesis to define it.

Something like tfl.ZeroPadding2D(input_shape=(,)).

1 Like