I am having the same error which also doesn’t occur when I use a batch size of 1.
Looped through the dataset and can confirm all images are 3x224x224 and all annotations are 1x224x224.
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 224 and 244 in dimension 2 at /tmp/pip-req-build-9oilk29k/aten/src/TH/generic/THTensor.cpp:689
How is that happening? It even says 224 and 224 in dimension 2 which doesn’t make sense. Shouldn’t this exception occur when they aren’t matching?