paulgavrikov/visualkeras

Visualkeras is a Python package to help visualize Keras (either standalone or included in TensorFlow) neural network architectures. It allows easy styling to fit most needs. This module supports layered style architecture generation which is great for CNNs (Convolutional Neural Networks), and a graph style architecture, which works great for most models including plain feed-forward networks.

What it solves

Visualkeras solves the problem of understanding and communicating the structure of Keras and TensorFlow neural network models. It provides visual diagrams that make it easier to inspect model architectures, debug, and present models in papers or reports.

How it works

Visualkeras offers multiple renderers: the layered view for sequential CNN-style diagrams, the graph view for node-based visualizations, the functional view for models with multiple inputs, outputs, or streams, and the LeNet view for classic feature-map stack diagrams. The recommended high-level API is show(...), which selects a renderer based on a mode argument (e.g., "layered", "graph", "functional", "lenet"). You can also call specific functions like layered_view(model) directly. The package is highly customizable, allowing options like collapsing repeated layers for cleaner diagrams.

Who it’s for

Visualkeras is aimed at developers, researchers, and students who build or study Keras or TensorFlow models and need clear visual representations. It is simple enough for quickstart use, yet offers advanced customization for power users.

Highlights

  • Supports multiple rendering styles: layered, graph, functional, and LeNet views.
  • Simple high-level API: visualkeras.show(model, mode="...") or specific functions like layered_view.
  • Highly customizable with options such as collapsing repeated layers.
  • Example code and documentation available on ReadTheDocs.
  • Compatible with Python 3.9+ and works with tf.keras and standalone Keras (mostly supported with TensorFlow backend).

Related

  • Project
  • Project
  • Project
  • Project