Using this to convert the image to a tensor:
    loader = transforms.Compose([transforms.Scale(image_size), transforms.ToTensor()])  # resize and convert to tensor
    image = loader(image)

Instead of this:
    loader = transforms.Compose([transforms.Scale(image_size), transforms.ToTensor()])  # resize and convert to tensor
    image = Variable(loader(image))

Results in:
TypeError: FloatSpatialConvolutionMM_updateOutput received an invalid combination of arguments - got (int, torch.cuda.FloatTensor, torch.FloatTensor, torch.FloatTensor, torch.FloatTensor, torch.FloatTensor, torch.FloatTensor, int, int, int, int, int, int), but expected (int state, torch.FloatTensor input, torch.FloatTensor output, torch.FloatTensor weight, [torch.FloatTensor bias or None], torch.FloatTensor finput, torch.FloatTensor fgradInput, int kW, int kH, int dW, int dH, int padW, int padH)

Edit:
I suspect the issue is probably related to these lines of code:
use_cuda = torch.cuda.is_available()
dtype = torch.cuda.FloatTensor if use_cuda else