Following the example from:

  
      github.com
  
  
    hugo1840/Pytorch_tutorial/blob/master/classification_cifar10.py 11
# -*- coding: utf-8 -*-
"""
Created on Tue May  8 20:45:03 2018

@author: Hugot
"""

# -*- coding: utf-8 -*-
"""
Training a classifier
=====================
For this tutorial, we will use the CIFAR10 dataset.
It has the classes: ‘airplane’, ‘automobile’, ‘bird’, ‘cat’, ‘deer’,
‘dog’, ‘frog’, ‘horse’, ‘ship’, ‘truck’. The images in CIFAR-10 are of
size 3x32x32, i.e. 3-channel color images of 32x32 pixels in size.

.. figure:: /_static/img/cifar10.png
   :alt: cifar10

   cifar10


  This file has been truncated. show original

  
  
    
    
  
  


This code trains successfully. I ran this code and saved model.
Now I want to predict my own image. I used the following code
import torch
from mod1 import Net
from PIL import Image
import numpy

image = Image.open("plane.png")

pix = numpy.array(image) #convert image to numpy array
image.show()
net = Net()
net.eval()
img = torch.Tensor(pix) #convert numpy array to tensor
net = torch.load('pytorch_Network.h5')
print(net(img))

But I got this error:
Traceback (most recent call last):
  File "/home/ihor/Tasks/try1/pytorch_load_model.py", line 14, in <module>
    print(net(img))
  File "/home/ihor/anaconda3/envs/tensorflow/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ihor/Tasks/try1/pytorch.py", line 51, in forward
    x = self.pool(F.relu(self.conv1(x)))
  File "/home/ihor/anaconda3/envs/tensorflow/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ihor/anaconda3/envs/tensorflow/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: Expected 4-dimensional input for 4-dimensional weight [6, 3, 5, 5], but got input of size [368, 860] instead

Sorry if this is a bit basic of a question, but for some reason I could not find much online to guide me on this. I have googled a lot, read different articles but nothing helps me.
Thanks