But I am able to read a gray-scale image as is, without needing to convert that to RGB:
>>> img = Image.open('img-gray.jpg')
>>> img_hflip = TF.hflip(img)
>>> img_tensor = TF.to_tensor(img_hflip)
>>> img_tensor.shape
torch.Size([1, 218, 178])

I still believe this error is related to things outside the dataloader.