magicleap/SuperPointPretrainedNetwork

PyTorch 1.4+ and grid_sample behavior

mihaidusmanu opened this issue · 1 comments

Starting in version 1.4.0 of PyTorch the default behavior of torch.nn.functional.grid_sample was changed to align_corners=False. This might affect the outputting descriptors for certain input image sizes when compared to PyTorch 1.3-. To fix it, one simply needs to modify L281 as follows:

desc = torch.nn.functional.grid_sample(coarse_desc, samp_pts)

desc = torch.nn.functional.grid_sample(coarse_desc, samp_pts, align_corners=True)

Thank you for pointing this out Mihai! It's annoying that they changed the default parameter value.

Unfortunately I don't have write privileges and can't update the code :/ but hopefully people find this