pytorch模型可视化 Posted on 2020-08-22 环境安装graphviz, pytorchviz 12pip install graphvizpip install git+https://github.com/szagoruyko/pytorchviz 示例: 123456789101112import torchfrom torch import nnfrom torchviz import make_dotfrom torchvision.models import AlexNetmodel = AlexNet()x = torch.randn(1, 3, 227, 227).requires_grad_(True)y = model(x)vis_graph = make_dot(y, params=dict(list(model.named_parameters()) + [('x', x)]))vis_graph.view() 使用模型查看工具