Visualize the architecture of a neural network with custom layers


This Content is from Stack Overflow. Question asked by Camilo Yañez

Is there any way to see the architecture of a neural network with custom layers?

I’m using a model that contains a custom position encoding, then a keras_nlp.layers.TransformerEncoder layer, and finally the classic GlobalAveragePooling1D and Dense layers.

I have tried with Keras Visualizer but I get the following error:
keras visualizer: layer not supported for visualizing.
I guess it’s because the custom layer.

The model.summary() gives me the correct data of my model, but I would like to see the architecture of the neural network similar to the following photo:
enter image description here


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?