remove the .cuda() and the torch.nn.DataParallel
filename=r’/Users/dti/Desktop/PyTorch4testAccuracy/hymenoptera_data/test/bees/1.jpg’
img = skimage.io.imread(filename)

x = V(centre_crop(img).unsqueeze(0), volatile=True)

model = models.dict['resnet18']
model = torch.load('model5.pth')

logit = model(x)
print(logit)