In the exercise 2 of the graded lab of week 2, if the below instruction is missing
tf.keras.Input(shape=(400,)), #specify input size
when creating the model, the call model.summary() shows below error
ValueError Traceback (most recent call last)
in
----> 1 model.summary()
/opt/conda/lib/python3.7/site-packages/keras/engine/training.py in summary(self, line_length, positions, print_fn, expand_nested, show_trainable)
2774 if not self.built:
2775 raise ValueError(
→ 2776 'This model has not yet been built. ’
2777 'Build the model first by calling build()
or by calling ’
2778 ‘the model on a batch of data.’)
ValueError: This model has not yet been built. Build the model first by calling build()
or by calling the model on a batch of data.
That instruction is not mandatory for the exercise. I wonder if it can be added to the base code of the exercise to avoid the errors and save some debugging time.