Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the usage of your code with PyTorch>=1.6.0 #22

Open
LinfengYuan1997 opened this issue Jun 17, 2021 · 2 comments
Open

About the usage of your code with PyTorch>=1.6.0 #22

LinfengYuan1997 opened this issue Jun 17, 2021 · 2 comments

Comments

@LinfengYuan1997
Copy link

Thanks for sharing your fantastic work!

I am using your code with PyTorch version >= 1.6.0. And it seems that the operation of F.affine_grid() & F.grid_sample() has been changed leading to the warning :

UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details. "Default grid_sample and affine_grid behavior has changed "

Because I don't know the running Pytorch version of your environment, I am not sure whether I need to change the align_corners argument.

The same issues occur for upsample function

UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and now uses scale_factor directly, instead of relying on the computed output size. If you wish to restore the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. "The default behavior for interpolate/upsample with float scale_factor changed "

Could you please tell me the running version of your PyTorch?

@zhangmozhe
Copy link
Contributor

Hi, we train the model using pytorch 1.5.0. We did not test the code on higher versions.

@LinfengYuan1997
Copy link
Author

Hi, we train the model using pytorch 1.5.0. We did not test the code on higher versions.

So you also met the warning about the "Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details. "Default grid_sample and affine_grid behavior has changed "", and a warning about 'mean' & 'reduction' of cross_entropy_2d(), right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants