Within Tensorflow, we can use tf.image.resize_images(img, img_h, img_w) to convert a feature map into another size.
How can we do the same thing in Pytorch?
tf.image.resize_images(img, img_h, img_w)
you can look at these Upsampling* modules to resize up:
To resize down, you can use AvgPool2d
It works for me.
Thank you very much.
Is there a way for fractional resize, e.g., 128x128 to 96x96?
Well, 128x128 -> 96x96 can be done by nn.UpsamplingNearest2d(scale_factor=3) followed by nn.AvgPool2d(4).
I hope I can use another direct way (with interpolation).
You can try FractionalMaxPooling.
Has this been implemented yet for float scale factors? Greatly appreciated!