mmengine icon indicating copy to clipboard operation
mmengine copied to clipboard

[Feature] Save optimizer-related params in the best epoch checkpoint

Open Tau-J opened this issue 2 years ago • 2 comments

What is the feature?

I notice that mmengine does not save optimizer-related params, e.g. learning rate, so user cannot resume training from the best checkpoint. However, in an industrial development, it is an important feature to resume training from the last best checkpoint.

Any other context?

No response

Tau-J avatar Oct 30 '23 02:10 Tau-J

@HAOCHENYE I suffered from the same issue. I think it's very unexpected from this class and should be considered a bug, rather than a feature request.

This line : https://github.com/open-mmlab/mmengine/blob/main/mmengine/hooks/checkpoint_hook.py#L564

Should reuse the same self.attribute as this line https://github.com/open-mmlab/mmengine/blob/main/mmengine/hooks/checkpoint_hook.py#L447

joihn avatar Dec 12 '23 10:12 joihn

I did a PR: https://github.com/open-mmlab/mmengine/pull/1454

joihn avatar Dec 12 '23 11:12 joihn