Expected stride to be a single integer value or a list?

From your code sample it looks like the batch dimension is missing.
Try to add img.unsqueeze_(0) to your code before passing the image to the model.

21 Likes