This the definintion of my data set but I got the same error. even I resize all image into the same size 224:
 image_transforms = {
    'train': transforms.Compose([
        transforms.Resize(size=224),
        transforms.RandomRotation(degrees=15),
        transforms.RandomHorizontalFlip(),

        transforms.ToTensor()]),
    'valid': transforms.Compose([
        transforms.Resize(size=224),
        transforms.ToTensor()])
}