title: load a pretrained model pytorch - dict object has no attribute eval
body: <pre><code>def save_checkpoint(state, is_best, filename='checkpoint.pth.tar'):
      torch.save(state, filename)
      if is_best:
          shutil.copyfile(filename, 'model_best.pth.tar')
  
  
  save_checkpoint({
                  'epoch': epoch + 1,
                  'arch': args.arch,
                  'state_dict': model.state_dict(),
                  'best_prec1': best_prec1,
                  'optimizer': optimizer.state_dict()
              }, is_best)
  </code></pre>
  
  <p>I am saving my model like this. How can I load back the model so that I can use it in other places, like cnn visualization? </p>
  
  <p>This is how I am loading the model now: </p>
  
  <pre><code>torch.load('model_best.pth.tar')
  </code></pre>
  
  <p>But when I do this, I get this error:</p>
  
  <blockquote>
    <p>AttributeError: 'dict' object has no attribute 'eval'</p>
  </blockquote>
  
  <p>What am I missing here???</p>
  
  <p>EDIT: I want to use the model that I trained to visualize the filters and grads. I am using this <a href="https://github.com/utkuozbulak/pytorch-cnn-visualizations/blob/master/src/misc_functions.py#L179" rel="noreferrer">repo</a> to make the vis. I replaced line 179 with <code>torch.load('model_best.pth.tar')</code></p>