is it possible to have a nice output of keras model.summary(), that can be included in paper, or can be ploted in a nice table like this.
Asked
Active
Viewed 2,807 times
4
-
How to get the output in dict format: https://stackoverflow.com/a/68128858/10375049 – Marco Cerliani Jun 25 '21 at 09:56
1 Answers
3
You need to install graphvis and pydot, but you might like the results from this. It doesn't make a table but the graph is much better in my opinion.
from keras.utils import plot_model
plot_model(model, to_file='model.png', show_shapes=True,show_layer_names=True)
But you would have to make properly named sub models if you want to nest the several layers together.

Andrew Louw
- 679
- 5
- 10
-
1Thank you for your reply, I tried this method before however for deep networks let's say Resnet50 it will give you a very long image ( because of the depth) that's why I'm thinking of something more tabular , so I can compact the representation and yet refer to the layer I want to specify in my paper (for instance layer conv2_branch1 ) – Reda Abdellah KAMRAOUI May 30 '19 at 13:19
-
you can combine several layers into a sub model and that would shorten the image, but I agree, it's not ideal – Andrew Louw May 31 '19 at 14:10