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

Exclude optimizer instances from the state_dict #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ricoshin
Copy link

@ricoshin ricoshin commented Dec 21, 2020

If attribute 'optimizer' as a python object are pickled together, one may encounter a compatibility issue when loading it back.
(unless the same optimizer module is imported from the same path to recognize the saved attributes.)

The self.optimizer, by default, expected to be filtered out, but self.after_scheduler.optimizer has to be taken into account as well. So, I've overriden relevant methods to exclude optimizer instances from the state_dict.

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

Successfully merging this pull request may close these issues.

1 participant