I am currently facing the same issue. My .bmp images with 1 channel are somehow converted into 3 channels. As I have found out now the issue seems to be caused by the ImageFolder function offered by pytorch. Is there any possibility to avoid ImageFolder converting the images into 3 channels? The only way I currently see is to use the grayscale transform, as a counter.