sniklaus / pytorch-spynet

a reimplementation of Optical Flow Estimation using a Spatial Pyramid Network in PyTorch
GNU General Public License v3.0
317 stars 47 forks source link

TypeError: grid_sample() got an unexpected keyword argument 'align_corners' #13

Closed ShaofengZou closed 4 years ago

ShaofengZou commented 4 years ago

It was triggered when running to

tensorFlow = torch.nn.functional.interpolate(input=moduleNetwork(tensorPreprocessedFirst, tensorPreprocessedSecond), size=(intHeight, intWidth), mode='bilinear', align_corners=False)

How can l solve this problem? Is that a cause of low pytorch version? Looking forward to your reply.

sniklaus commented 4 years ago

Which version of PyTorch are you using?

ShaofengZou commented 4 years ago

I have tried on 1.0.0 , 1.0.1.post2 and 1.1.0. None of these three versions successfully worked.

sniklaus commented 4 years ago

I just checked and align_corners got introduced to grid_sample with PyTorch 1.3.0, so you can either meet this minimum version or remove the align_corners attribute from the grid_sample call.

ShaofengZou commented 4 years ago

All right. I have make it worked by adding align_corners to the grid_sample call. Thank you very much!