Hi DrOrstxo,
sorry, I dont quite follow, I did have datasets.ImageFolder(phase_dir, transform=phase_transforms) just before the ‘if’ sentence as below:
phase_dataset = datasets.ImageFolder(phase_dir, transform=transform)
if phase == ‘train’:
dataloaders = torch.utils.data.DataLoader(phase_dataset, batch_size = batchsize, shuffle = True)
else:
dataloaders = torch.utils.data.DataLoader(phase_dataset, batch_size = batchsize, shuffle = False)