I have a Pytorch tensor of size (4,3,224,224). When I am trying to convert the first tensor into an Image object, it says:
TypeError: Cannot handle this data type
I ran the following command:
img = Image.fromarray(data[0][i].numpy().astype(np.uint8))
where data is the Pytorch tensor
I tried other solutions but couldn't find any solution.
Please suggest !!