futscdav:

Most likely caused by having grayscale images in the dataset. Add .convert('RGB') after loading your PIL image in the dataloader.


Make sense! I will try what you suggested and then I say here if it worked.
But the images that I am using are from ImageNet. Is there the possibility of exist grayscale images among the RGB images?