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

ActNorm reinitializes on model load #6

Open
djd1283 opened this issue May 2, 2019 · 3 comments
Open

ActNorm reinitializes on model load #6

djd1283 opened this issue May 2, 2019 · 3 comments

Comments

@djd1283
Copy link

djd1283 commented May 2, 2019

Thank you for the repo! Upon reloading the Glow model from save after training, cross entropy performance diminished. This was likely because the ActNorm module was being reinitialized on the first input batch to a value the model didn't expect. I added a constructor flag to specify whether to reinitialize, and this seemed to fix the problem. I would imagine this is a larger issue for datasets with larger variance and smaller batch size.

Fix:

  • add an initialized flag to ActNorm constructor, set True when loading model
@MrHuff
Copy link

MrHuff commented May 3, 2019

Hi! Well spotted, would you mind sharing your code/the bug fix?

Thank you!

@rosinality
Copy link
Owner

rosinality commented May 3, 2019

Hello, thanks for your suggestions! I haved missed that cases...I fixed this at f332121 by changing initialized flag as module buffers. So it will be saved with model weights.

@djd1283
Copy link
Author

djd1283 commented May 5, 2019

Awesome! Thanks for the fix.

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

3 participants