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
Make RunningAverage
and Rouge
serializable
#3035
Make RunningAverage
and Rouge
serializable
#3035
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sadra-barikbin, PR looks good to me!
Can you please check and report here how it works on MNIST while saving and resuming.
As a test example, please use:
https://github.com/pytorch/ignite/blob/11a1fba0594f6ac0db9e8bc5f21305dc338bb7c1/examples/mnist/mnist_save_resume_engine.py
Here are few instructions on https://github.com/pytorch/ignite/blob/master/examples/mnist/README.md#training-save--resume
Finally, we can also update mnist_save_resume_engine.py
code adding RunningAverage metric for batch loss to the trainer and plotting it.
Regarding your comment in the main PR, I introduced a new if branch in metrics = {'acc': Accuracy(), 'nll': Loss()}
to_save={'model':model, 'trainer':trainer, 'metrics': metrics} How is this? |
RunningAverage
and Rouge
serializableRunningAverage
and Rouge
serializable
Now
state_dict
could serialize metric attributes that themselves are metric or simple collections of metrics.(ForRouge
). If an attribute isNone
,state_dict
sets the same in the dict (for_value
inRunningAverage
)Follow-up PR to #3001