Murilo Souza
Murilo Souza

Reputation: 45

Plotting model in Keras

I'm trying to plot my model in Keras, like this:

# Plot model graph
tf.keras.utils.plot_model(model, to_file='Model1.png')
from IPython.display import Image
Image(retina=True, filename='Model1.png')

Which I get the following result: my model

But, I've seen somewhere in the internet, that someone plotted his model, like this: model I need

How can I change my code to plot like that? With the input/output information of each layer of my model?

Upvotes: 3

Views: 6943

Answers (1)

JennyH
JennyH

Reputation: 302

You can use the parameter show_shapes=True.

from the tf.keras documentation:

show_shapes: whether to display shape information.

(have a closer look here: https://www.tensorflow.org/api_docs/python/tf/keras/utils/plot_model )

Upvotes: 3

Related Questions