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

Fix serialization for saving train checkpoints #271

Merged
merged 1 commit into from
Mar 5, 2020

Conversation

tanaysoni
Copy link
Contributor

With #220, a lambda function for loss aggregation got added in the AdaptiveModel that breaks the pickling of its instance objects. This causes an error when torch.save() is executed while saving a Train checkpoint.

This PR introduces dill, an extension of Python's standard pickling module that supports serialization and de-serialization of lambdas and other exotic types. torch.save() allows specifying the pickling module to use when saving objects.

@tanaysoni tanaysoni requested a review from tholor March 4, 2020 17:49
Copy link
Member

@tholor tholor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Didn't know about dill before. Looks helpful

@tanaysoni tanaysoni merged commit 9ec88d4 into master Mar 5, 2020
@tanaysoni tanaysoni deleted the fix-checkpoint-serialization branch March 5, 2020 08:56
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.

None yet

2 participants