Second assignment of first week, DLS course 4

help! I checked my code millions of time, for the first exercise “happyModel” , I keep receiving an error in second cell after creating def happyModel(), which is :
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)
34 result =
35 for layer in model.layers:
—> 36 descriptors = [layer.class.name, layer.output_shape, layer.count_params()]
37 if (type(layer) == Conv2D):
38 descriptors.append(layer.padding)

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in output_shape(self)
2177 “”"
2178 if not self._inbound_nodes:
→ 2179 raise AttributeError('The layer has never been called ’
2180 ‘and thus has no defined output shape.’)
2181 all_output_shapes = set(

AttributeError: The layer has never been called and thus has no defined output shape.

I think this error has nothing to do with my code and I don’t know how to fix this problem

Did you include the input_shape=(…) parameter in the ZeroPadding2D() layer?

Sorry, but I think that error has everything to do with your code. The best idea would be to spend 15 minutes studying this thread which gives a much nicer explanation of how the Keras Sequential and Functional APIs work than what is given to us in the notebook. Then go back and re-examine your code with that knowledge in mind and I hope that things will be a lot clearer.

Of course if you still have problems even after studying that thread, please ask more followup questions and we will be here to help.

thank you!