I think we can directly splot the dataset from ImageFolder and pass it to data loader this way.
dataset=torchvision.datasets.ImageFolder('path')
train, val, test = torch.utils.data.random_split(dataset, [1009, 250, 250])
traindataset = MyLazyDataset(train,aug)
valdataset = MyLazyDataset(val,aug)
testdataset = MyLazyDataset(test,aug)
num_workers=2
batch_size=6
trainLoader = DataLoader(traindataset , batch_size=batch_size, 
                                           num_workers=num_workers,  shuffle=True)
valLoader = DataLoader(valdataset, batch_size=batch_size, 
                                          num_workers=num_workers )
testLoader = DataLoader(testdataset, batch_size=batch_size, 
                                          num_workers=num_workers)

PS: I am writing this because I found this question useful