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 ??
I have kind of the same problem but I’m trying to call to_pil_image on a tensor that consists of sequences of grayscale images. [seq_len, width, height]. How can I call this function on all images? Because now it thinks that my image has 10 (10-seq_len) channels.