Hey guys, I’m trying to resize all my images to 256. I modified the code I was using to train my model as follow:
from torchvision import transforms

trans = transforms.Compose([
    transforms.Resize(256),
    transforms.ToTensor(),
])

And saving by using
 for img_batch, label_batch, path_batch in dataloader:
    for img, path in zip(img_batch, path_batch):
      save_image(img, filename)

But that doesn’t work, it says there’s an issue with the dimensions. If I add a CenterCrop to my transformations it works.
    transforms.Resize(256),
    transforms.CenterCrop(256),
    transforms.ToTensor(),

Can anyone explain this behavior?
Thanks