In Exercise 1 HappyModel
I tried following TensorFlow Keras 2.9.1 documentation and added layers using 1) adding layers directly in constructor , or 2) use model.add() method, but at testing both methods I got the error from the grader
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)
30 result =
31 for layer in model.layers:
â> 32 descriptors = [layer.class.name, layer.output_shape, layer.count_params()]
33 if (type(layer) == Conv2D):
34 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 need help to understand why the grader does not see the layer I added.
My lab ID is mahftzaa