def make_loader():
    trans = transforms.Compose([transforms.ToTensor(),
                            transforms.Normalize((0.5,0.5,0.5),(0.5,0.5,0.5)),
                            transforms.RandomHorizontalFlip(0.5)])
    trainset = torchvision.datasets.ImageFolder(root='/content/drive/My Drive/All Data', transform=trans)
    loader = DataLoader(trainset, batch_size=BATCH_SIZE, shuffle=True)

    return loader
loader = make_loader()

----> 5     for data in loader:
--> 414         raise TypeError('img should be PIL Image. Got {}'.format(type(img)))
TypeError: img should be PIL Image. Got <class 'torch.Tensor'>

So, I modified the code.
But,
def make_loader():
    trans = transforms.Compose([transforms.ToPILImage(),
                            transforms.ToTensor(),
                            transforms.Normalize((0.5,0.5,0.5),(0.5,0.5,0.5)),
                            transforms.RandomHorizontalFlip(0.5)])
    trainset = torchvision.datasets.ImageFolder(root='/content/drive/My Drive/All Data', transform=trans)
    loader = DataLoader(trainset, batch_size=BATCH_SIZE, shuffle=True)

    return loader
loader = make_loader()

----> 5     for data in loader:
--> 100         raise TypeError('pic should be Tensor or ndarray. Got {}.'.format(type(pic)))
TypeError: pic should be Tensor or ndarray. Got <class 'PIL.Image.Image'>.

how to solve this problem?
or Let me know if you know a simple way to create a dataloader that randomly reverses images when you call.