C4W1 Assignment 2 Ex1 AttributeError: 'list' object has no attribute 'compile'

Hi,
I got this error and have no idea how to solve this. Please recommend any solution

AttributeError 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

~/work/release/W1A2/test_utils.py in summary(model)
25 # extracts the description of a given model
26 def summary(model):
—> 27 model.compile(optimizer=‘adam’,
28 loss=‘categorical_crossentropy’,
29 metrics=[‘accuracy’])

AttributeError: ‘list’ object has no attribute ‘compile’

Hello @Nguyen_Nhan, Please check your above graded function part, and make sure u have added all the tensorflow layers as SPECIFIED in the comments inside the tf.keras.Sequential() layer from which you instantiate a sequence model, inside the happyModel() function.

Thanks for your help. Solved it.