From f5cf8555ef78117efe8fea810b9ed9ee0d54bb6f Mon Sep 17 00:00:00 2001 From: edwardpwtsoi <35715147+edwardpwtsoi@users.noreply.github.com> Date: Sun, 13 Oct 2019 20:57:50 +0800 Subject: [PATCH] updated grid_sample arg align_corners=True UserWarning: Default grid_sample and affine_grid behavior will be changed to align_corners=False from 1.4.0. See the documentation of grid_sample for details. --- modules/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/transformation.py b/modules/transformation.py index 7c4dd5a..ded2684 100755 --- a/modules/transformation.py +++ b/modules/transformation.py @@ -30,7 +30,7 @@ class TPS_SpatialTransformerNetwork(nn.Module): batch_C_prime = self.LocalizationNetwork(batch_I) # batch_size x K x 2 build_P_prime = self.GridGenerator.build_P_prime(batch_C_prime) # batch_size x n (= I_r_width x I_r_height) x 2 build_P_prime_reshape = build_P_prime.reshape([build_P_prime.size(0), self.I_r_size[0], self.I_r_size[1], 2]) - batch_I_r = F.grid_sample(batch_I, build_P_prime_reshape, padding_mode='border') + batch_I_r = F.grid_sample(batch_I, build_P_prime_reshape, padding_mode='border', align_corners=True) return batch_I_r