The link below might help you.

  
      
      Deep Learning Course Forums – 1 May 18
  
  
    

Image normalization in PyTorch 1.5k

Hi,  yes. You need to calculate the mean and std in advance. I did it the following way:  transform = transforms.Compose([     transforms.ToPILImage(),     transforms.ToTensor() ])  dataloader = torch.utils.data.DataLoader(*torch_dataset*,...