Solved by ptrblck in post #2 
              
              
                You have to transform the images into Tensors. 
You could use this code taken from the ImageNet example: 
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                     std=[0.229, 0.224, 0.225])

    train_dataset = datasets.ImageFolder(
        traindir,
        …