this is how I changes according to your pseudo-)code:
`from __future__ import division
import torch
torch.manual_seed(0)
import torchvision
import torchvision.transforms as transforms
from torch.autograd import Variable
from PIL import Image, ImageOps, ImageEnhance

model=torch.load('last_brain1.pth')
#print(mod)

model = model()  # Initialize model
model=torch.load('last_brain1.pth')  # Load pretrained parameters
model.eval()  # Set to eval mode to change behavior of Dropout, BatchNorm

transform = transforms.Compose(
    [transforms.ToTensor(),
     transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])  # Same as for your validation data, e.g. Resize, ToTensor, Normalize, ...

img = Image.open('C:\dataset\FYP\210.png')  # Load image as PIL.Image
x = transform(img)  # Preprocess image
x = x.unsqueeze(0)  # Add batch dimension

output = model(x)  # Forward pass
pred = torch.argmax(output, 1)  # Get predicted class if multi-class classification
print('Image predicted as ', pred)`

here is script   of my model:
 #testing
    loss=0.0
    correct=0
    total=0.0
    itr=0
    model.eval()
    for images,labels in testloader:
        images=Variable(images)
        labels=Variable(labels)
        #CUDA=torch.cuda.is_available()
        #if CUDA:
            #images=images.cuda()
            #labels=labels.cuda()
            
        
 
         
             

        outputs=model(images)
        loss=criterion(outputs,labels)
        loss+=loss.item()
        _,predicted=torch.max(outputs,1)
        total += labels.size(0)
        correct+=(predicted==labels).sum()
        itr+=1
    testloss.append(loss/itr)
    testaccuracy.append((100*correct/len(testset)))
    
    
    print('training loss:%f %%' %(itrloss/itr))
    print('training accuracy:%f %%'%(100*correct/len(trainset)))
    print('test loss:%f %%'%(loss/itr))
    print('test accuracy:%f %%'%((100*correct/len(testset))))
print('Accuracy of the network on the  test images: %d %%' % (
    100 * correct / total))


class_correct = list(0 for i in range(3))
class_total = list(0 for i in range(3))
with torch.no_grad():
    for data in testloader:
        images, labels = data
        images = Variable(images)
        labels = Variable(labels)
        outputs = model(images)
        _, predicted = torch.max(outputs, 1)
        c = (predicted == labels).squeeze()
        #class_total=[]
        for i in range(labels.size(0)):
            label = labels[i]
            class_correct[label] += c[i].item()
            class_total[label] += 1
for i in range(3):
    print('Accuracy of %5s : %2f %%' % ( classes[i], 100 * class_correct[i] / class_total[i]))