@ptrblck Is there a way to make ToTensor() scale to 0-255 instead of 0-1? Or would I manually have to convert to a [0, 255] Tensor?
Edit: I think this might work
def preprocess(img):
  mean_pixel = torch.DoubleTensor([103.939, 116.779, 123.68])
  img = torch.FloatTensor(img)
  mean_pixel_image = torch.Tensor()
  mean_pixel_image.resize_as_(img).copy_(mean_pixel)
  mean_pixel_image = mean_pixel_image.float()
  img = img - mean_pixel_image
  return img

image = spi.imread(params.image, mode="RGB").astype(float)
image = imresize(image, params.image_size, interp='bilinear')
image = preprocess(image)

But that results in this when trying to run my net forward with the image:
    net.updateOutput(image)
  File "/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/Sequential.py", line 36, in updateOutput
    currentOutput = module.updateOutput(currentOutput)
  File "/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/SpatialConvolution.py", line 84, in updateOutput
    self._viewWeight()
  File "/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/SpatialConvolution.py", line 75, in _viewWeight
    self.gradWeight = self.gradWeight.view(self.nOutputPlane, self.nInputPlane * self.kH * self.kW)
RuntimeError: invalid argument 2: size '[64 x 27]' is invalid for input with 0 elements at /home/ubuntu/pytorch/aten/src/TH/THStorage.c:41