The issue is in fact the other way around.
You are currently feeding single channel images, while an RGB image is expected, so you might fake the color channels for each grayscale image.
You might use torchvision.transforms.Grayscale(num_output_channels=3) for it.
I’m not sure, which loss function you are using, but if you are using nn.CrossEntropyLoss or nn.NLLLoss, your target should be a LongTensor containing the class indices instead of a one-hot encoded vector.
PS: You can add code snippets by wrapping them in three backticks ```