Make RunningAverage and Rouge serializable#3035
Conversation
vfdev-5
left a comment
There was a problem hiding this comment.
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_dictcould serialize metric attributes that themselves are metric or simple collections of metrics.(ForRouge). If an attribute isNone,state_dictsets the same in the dict (for_valueinRunningAverage)Follow-up PR to #3001