Hello all, I am new to pytorch.
I made a model that returns shape (1, 128, 128) tensor and wanted to resize it to (1, 101, 101). To use transforms.Resize(), I converted the tensor to PIL image using transforms.ToPILImage(mode=‘L’) function. Then, the system said ‘ValueError: Only modes [‘RGB’, ‘YCbCr’, ‘HSV’] are supported for 3D inputs’ !!
But, I think my tensor has 1 channel not 3D inputs.
my question is

how to convert 1 channel tensor to PIL Image ?
is there better way to resize tensor than i did ??

Thanks in advance!