I have an output tensor called output of shape [12000, 12000, 3] and of type uint8. It is a tensor of RGB values ranging in [0, 255]. I am trying to save it using the following line
Hi @eqy@ptrblck, any ideas? I just tagged you both because you both have been great help for me on this forum. I’ve been scratching my head at this for a bit but I can’t seem to find any solutions online. Thank you!
To convert your tensor into the image tensor format, it has to be in the format (batch_size, channels, height, width). To achieve this, you can permute the image using the permute() function.
permuted_tensor = tensor.permute(0, 1, 2, 3),
Again, keep in mind that your tensor might only have 3 dimensions, the height, width and channel, to add another dimension of batch size you can run: