I am using ResNet18 to do some transfer learning for a project. I have been able to follow the Transfer Learning Tutorial 80 without any real issue (I am using a feed forward DNN for ‘fc’ with a final layer that classifies 102 categoires instead of 1000).
However, after my model is trained, I of course want to perform inference on some test data (images). The problem is when I try to do something like this:

# img is a [3,224,224] Tensor just like all the other images during training
img = process_image(image_path)
model.eval()
with torch.no_grad():
      outputs = model(img) # Note that wrapping this in a Variable() results in the samething

It throws a somewhat cryptic exception:

RuntimeError: expected stride to be a single integer value or a list of 1 values to match the convolution dimensions, but got stride=[2, 2]

Does anyone know what I’m doing wrong or how I can perform inference using ResNet18?