The size after turning into Gray isn’t [10,244,244] but [10,1,244,244]
You can do this easily with
torchvision.transforms. Grayscale ( num_output_channels=1 )
here is a little tutorial for this:
https://pytorch.org/tutorials/beginner/data_loading_tutorial.html 195
If you need the form [10,224,224] you cann use
pictures.view(10,244,244)