Shown here is the network structure of the symbol class mxnet
If you want to print parameter dimension, then the code is very simple, just the following line, you can generate a pdf file to show the picture in the form of network structure
mx.viz.plot_network(sym, shape={"data":(1, 1, 32, 32)}).view()
Wherein the (1, 1, 32, 32) is the dimension of input, i.e., Shape, where a single channel of input picture size 32 * 32 image, adjusted according to actual situation
This method relies Graphviz, the following command can be installed
conda install graphviz
However, this method can only print convolution kernel dimension, i.e. a dimension parameter, rather than the dimension of each layer of the output layer,
To print the output layer dimension is also very simple, as follows:
mx.viz.print_summary(sym, shape={"data":(1, 1, 32, 32)})
——————————————————————————————————————
For printing output dimension HybridSequential class, as follows:
mx.viz.print_summary(
net(mx.sym.var('data')),
shape={'data':(1,3,224,224)}, #set your shape here
)
——————————————————————————————————————