Thanks for your response. The shape of train_ds_DNA  is (1848, 135, 135). Using x = x.unsqueeze(0) after x = self.data[index] in the above code, I get this to  (1848, 1, 135, 135). The reason for using tt.Grayscale is to get the shape to (1848, 3, 135, 135) with same data in the three channels. But this transform seems to require three channels in the input image. Is that not what it is supposed to do? The error now is Input image tensor should 3 channels, but found 1
Thanks again for your time.