Tensorflow – Create CNN model architecture diagram in Keras

conv-neural-networkdeep-learninggraphvizkerastensorflow

I followed the tutorial to create visually graphical representation of CNN model using this: https://keras.io/visualization/

My code at the moment is as follows:

from keras.utils import plot_model
from keras.applications.resnet50 import ResNet50
import numpy as np

model = ResNet50(weights='imagenet')
plot_model(model, to_file='model.png')

When I use the aforementioned code I am able to create a graphical representation (using Graphviz) of ResNet50 and save it in 'model.png'. But I want to create block diagram of the CNN model with the layers instead. An example of my desired output is as follows:
enter image description here

Any idea how I can achieve the aforementioned block diagram programatically instead of just generating the graph diagram of the CNN model?

Best Answer

Here is a comprehensive list of existing solutions (not only for Keras): How do you visualize neural network architectures?.

Pay attention on Netron.

Related Topic