Late to the discussion, but for future reference because it took me a while to figure this out:
Some of the models (Alexnet, VGG) will run into this error because they are expecting a certain image size. If you include:
transforms.Resize([224, 224])
in your transforms (224 specifically is what works for me) you will avoid this error. See: https://www.pyimagesearch.com/2017/03/20/imagenet-vggnet-resnet-inception-xception-keras/ 94