Hi I’m also getting this error with the most updated pytorch and torchvision. My transforms are
transform = transforms.Compose([torchvision.transforms.RandomCrop(size=(16, 16)), 
                                torchvision.transforms.RandomHorizontalFlip(p=0.5), 
                                torchvision.transforms.ToTensor(),
                                torchvision.transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
                               ])

If I comment the ToTensor() transform out I instead get an “Unexpected type <class ‘numpy.ndarray’>” error.
The error shows up when I’m calling this line in my training function.
for i, (x, y) in enumerate(loader):

It works though when I just have the ToTensor and Normalise transform, but not the first 2