title: How do I visualize a net in Pytorch?
body: <pre><code>import torch
  import torch.nn as nn
  import torch.optim as optim
  import torch.utils.data as data
  import torchvision.models as models
  import torchvision.datasets as dset
  import torchvision.transforms as transforms
  from torch.autograd import Variable
  from torchvision.models.vgg import model_urls
  from torchviz import make_dot
  
  batch_size = 3
  learning_rate =0.0002
  epoch = 50
  
  resnet = models.resnet50(pretrained=True)
  print resnet
  make_dot(resnet)
  </code></pre>
  
  <p>I want to visualize <code>resnet</code> from the pytorch models. How can I do it? I tried to use <code>torchviz</code> but it gives an error:</p>
  
  <pre><code>'ResNet' object has no attribute 'grad_fn'
  </code></pre>