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
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.