How to load datasets using torchvision.datasets.Imagefolder and divide into train and test?


(Sreenivas) #1
dataset = datasets.ImageFolder(root='/data_path', transform=transform)

After the above code, how can I split the dataset into 20 percent for testing and 80 percent for training and load into torch.utils.data.DataLoader?


#2

Here’s an example from somewhere else.