removed align_corners=True

Got this error in Pytorch 1.1.0:
TypeError: grid_sample() got an unexpected keyword argument 'align_corners'
This commit is contained in:
varshaneya 2019-10-23 11:35:37 +05:30 committed by GitHub
parent 9a6f6678b1
commit 53509eab01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class TPS_SpatialTransformerNetwork(nn.Module):
batch_C_prime = self.LocalizationNetwork(batch_I) # batch_size x K x 2 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 = 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]) 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', align_corners=True) batch_I_r = F.grid_sample(batch_I, build_P_prime_reshape, padding_mode='border')
return batch_I_r return batch_I_r