To my understanding you need to resize your images and normalize the colors in them to get the best results. An example is as follows.
data_transform = transforms.Compose([
    transforms.Resize(224),
    transforms.CenterCrop(224),
    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]), 
    

You would then pass this transform as a parameter for your datasets like this:
datasets.ImageFolder(path_to_training_directory, transform=data_transform)