torchviz 可视化pytorch
install
sudo apt-get install xdg-open
sudo apt-get install graphviz
pip install graphviz
use
from torchviz import make_dot
x = Variable(torch.randn(1, 3, 300, 300))
y = net(x)
vis_graph = make_dot(y, params=dict(net.named_parameters()))
vis_graph.view()