Last_One:

I get this error: pic should be PIL Image or ndarray. Got <class ‘str’>


All the transformations listed under Transforms on PIL Image need to be done on PIL image and not a tensor or ndarray.
Meaning they should be done before torchvision.transforms.ToTensor(), because this transforms your PIL image or ndarry to a tensor.
I you need, you can also do it in the opposite direction and transform a tensor or a ndarray to a PIL image using torchvision.transforms.ToPILImage()