Hi all,
I was wondering whether has anyone done bilinear interpolation resizing with PyTorch Tensor under CUDA?
I tried this using torch.nn.functional.F.interpolate(rgb_image,(size,size)) and it works to resize the RGB image tensor shape (batch,channel,size,size). However, the default mode is ‘nearest’ and when I change to ‘bilinear’, it comes with an error about the tensor type which I fixed by changing to torch.FloatTensor but then the output shown is grainy and pixelated with noise. My command:
resized = F.interpolate(rgb_image_tensor.type(torch.FloatTensor),(256,256),mode='bilinear')

I show the image by using
result =  torchvision.transform.functional.to_pil_image(resized[0])
result.show()

Default way works, shows the image is resized accordingly but ‘bilinear’ shows noisy image, any clues?
‘bilinear’ mode output: