1

According to this page, MXNet computation graph can be visualized using mx.viz.plot_network(net).

But that only works on Jupyter notebook. How do I do it without Jupyter notebook? Is it possible to save the visualization as a image in a file?

Indhu Bharathi
  • 1,437
  • 1
  • 13
  • 22

1 Answers1

7

mx.viz.plot_network returns a graphviz.dot.Digraph object and it can be rendered to file like any other Digraph object.

Here is an example:

# Store the Digraph in a variable
graph = mx.viz.plot_network(net)

# Pick an image format from this list: http://www.graphviz.org/doc/info/output.html
graph.format = 'png'

# Choose a filename and render the image.
graph.render('graph')

Above code will render the graph in 'graph.png' in the current directory.

Indhu Bharathi
  • 1,437
  • 1
  • 13
  • 22