I dont know why it is still not working for me. Here is my transforms and dataloader if it helps…
train_dir = ‘train’
valid_dir = ‘valid’
test_dir = ‘test’
dirs = {
‘train’: train_dir,
‘valid’: valid_dir,
‘test’: test_dir
}
Data Transforms:
data_transforms = {
‘train’: transforms.Compose([
    transforms.RandomRotation(40),
    transforms.RandomHorizontalFlip(),
    transforms.RandomVerticalFlip(),
    transforms.ColorJitter(brightness = [1,1.2]),
    transforms.RandomAffine(20,translate =(0.1,0.1),scale=(0.9,1.25)),
    transforms.Resize(224),

    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], 
                                        [0.229, 0.224, 0.225])
]),
'valid': transforms.Compose([

    transforms.Resize(224),
    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], 
                                        [0.229, 0.224, 0.225])
]),

}
Load the datasets with ImageFolder - No testset at the moment
image_datasets = {x: datasets.ImageFolder(dirs[x],   transform=data_transforms[x]) for x in [‘train’, ‘valid’]}
load the data into batches
dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x],drop_last=True, batch_size=32, shuffle=True) for x in [‘train’, ‘valid’]}
dataset_sizes = {x: len(image_datasets[x])
for x in [‘train’, ‘valid’]}
class_names = image_datasets[‘train’].classes