title: pytorch: can't load CNN model and do prediction TypeError: 'collections.OrderedDict' object is not callable
body: <p>I trained a CNN model using MNIST dataset and now want to predict a classification of the image, which contains a number 3.</p>
  
  <p>But when I tried to use this CNN to predict, pytorch gives me this error:</p>
  
  <pre><code>TypeError: 'collections.OrderedDict' object is not callable
  </code></pre>
  
  <p>And here's what I write:</p>
  
  <pre><code>cnn = torch.load("/usr/prakt/w153/Desktop/score_detector.pkl")
  img = scipy.ndimage.imread("/usr/prakt/w153/Desktop/resize_num_three.png")
  test_x = Variable(torch.unsqueeze(torch.FloatTensor(img), dim=1), volatile=True).type(torch.FloatTensor).cuda()
  test_output, last_layer = cnn(test_x)
  pred = torch.max(test_output, 1)[1].cuda().data.squeeze()
  print(pred)
  </code></pre>
  
  <p>here's some explaination:
  <code>img</code> is the to be predicted image with size 28*28 <code>score_detector.pkl</code> is the trained CNN model</p>
  
  <p>any help will be appreciated! </p>