@ptrblck can you please check the code. Is it correct?

dataset=torchvision.datasets.ImageFolder(‘images/’)
kfold = LeaveOneGroupOut()
for fold,(train_idx,val_idx) in enumerate(kfold.split(dataset,groups=dataset.targets)):
train_subsampler = torch.utils.data.SubsetRandomSampler(train_idx)
val_subsampler = torch.utils.data.SubsetRandomSampler(val_idx)