ERROR DEBUGGING 1
I’m having the same error message when using the official datasets from torchvision such as CIFAR10. It’s because of transforms.Scale((32,32)). If you remove the scale, it’s fine. It seems like a bug.
ERROR DEBUGGING 2
I then went on to understand scale works on PIL. So I went to use ToPILImage first.
So now I’ve
transform_trf = transforms.Compose([transforms.ToPILImage(),
                                    transforms.Scale(size=[28, 28]),
                                    transforms.ToTensor(),
                                    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
                                    ])

Error given AssertionError: pic should be Tensor or ndarray.
ERROR DEBUGGING 3
Naturally I would think there’s a need for Tensor so I added a toTensor() operation.
transform_trf = transforms.Compose([transforms.ToTensor(),
                                    transforms.ToPILImage(),
                                    transforms.Scale(size=[28, 28]),
                                    transforms.ToTensor(),
                                    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
                                    ])

Now there’s this error which is hard to debug TypeError: unsupported operand type(s) for /: 'list' and 'int'
I was hoping someone can clarify what’s happening here.
@smth @apaszke