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

The BN running mean&var with torch.utils.checkpoint.checkpoint #73

Closed
ljn114514 opened this issue Oct 4, 2020 · 2 comments
Closed

The BN running mean&var with torch.utils.checkpoint.checkpoint #73

ljn114514 opened this issue Oct 4, 2020 · 2 comments

Comments

@ljn114514
Copy link

How do you deal with the bn running mean/variance? Because the BatchNorm would be calculated twice (once during the forward pass and once during recomputation in the backward pass), and the running mean&var would updated twice.

@gpleiss
Copy link
Owner

gpleiss commented Oct 5, 2020

This is a good point. Ideally, PyTorch's batch norm layers should be smart enough to update the running mean/var appropriately with the checkpointing operation.

If this is not the case, then you should raise an issue with PyTorch, since the checkpointing/batch norm layers are part of their library, not this library.

@ljn114514
Copy link
Author

Ok, thanks for your reply

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