Course4 Week1 Assignment2 : Happy Model

I’m stuck with the following error and i’m unable to debug it.

PS: I’m new to TF. Please help.

1 Like


I don’t know what kind of value inside ‘value’ but, you can use .lower() with strings. Did you try for loop ? :wink:

Than you, Omer. I think the error is pointing to the happy model definition. More specifically, here:

tf.keras.layers.ZeroPadding2D(padding=(3,3), data_format=(64,64,3)),

I don’t know where i’m going wrong.

data_format = value.lower() # Error happens here.

“value” variable is a tuple object.

data_format = [v.lower() for v in value]


for v in value:
    data_format = v.lower()

First you can use tfl instead of tf.keras.layers because it’s already imported in the first place
Second you need to set tfl.ZeroPadding2D(padding=(3,3), input_shape=(64,64,3)) (input_shape not the data_format)


Why are you using a “data_format” argument?

Thank you for your reply. I realised my error. I’ve corrected my code.

1 Like

I’m glad to hear that :slightly_smiling_face: