Closed TechieBoy closed 4 years ago
Thank you for bringing this to my attention, I changed the grid sampler to align_corners=True
since this is what the reference implementation does (and the provided models were trained with this configuration). I appreciate that you bring it up since the default changed to align_corners=False
with the newest PyTorch release, which breaks backwards compatibility: https://github.com/pytorch/pytorch/pull/23923
In the current code,
grid_sample()
is not passed thealign_corners
parameter so it is set to True as described here https://github.com/sniklaus/pytorch-pwc/blob/1a5f1969c51a865cd184450f76251ba1f77b07e9/run.py#L61However,
interpolate()
hasalign_corners
set to False. https://github.com/sniklaus/pytorch-pwc/blob/1a5f1969c51a865cd184450f76251ba1f77b07e9/run.py#L299From the pytorch docs: The
align_corners
option parallels thealign_corners
option ininterpolate()
, and so whichever option is used here should also be used there to resize the input image before grid sampling.Is this intended? If not, then
align_corners=False
needs to be passed in to thegrid_sample()
function.