Course 4 - Week 4 - Assignment 2 pretty printing problem

The only output I get from the second input block (which ends with pp.pprint(vgg)) is as follows:
<tensorflow.python.keras.engine.functional.Functional object at 0x7ff42975b438>

I was expecting a “pretty printed” output showing the details of the VGG model. Suggestions?

That’s as expected. There’s nothing printable.

There are ways to visualize details of a model, though. One is [tf.keras.utils.plot_model  |  TensorFlow Core v2.7.0]

Sorry, but I still don’t understand. Why are we bothering to “pretty print”, when print(vgg) has the same effect as pp.pprint(vgg)?

There are two lines of code preparing for pretty-printing:
pp = pprint.PrettyPrinter(indent=4) img_size = 400

It’s a mistake in the notebook.

1 Like