Lightning-AI/pytorch-lightning

Easier change optimizer/learning rate instead of reading state_dict from checkpoint

Open

#4,044 建立於 2020年10月10日

在 GitHub 查看
 (12 留言) (0 反應) (0 負責人)Python (3,233 fork)batch import
featurehelp wanted

倉庫指標

Star
 (26,687 star)
PR 合併指標
 (平均合併 9天 15小時) (30 天內合併 3 個 PR)

描述

🚀 Feature

Easier change optimizer / learning rate without recoding

Motivation

Usually when we want to change the optimizer from one to another(for example,using Adam to fast init training and turn to SGD at the end) in PyTorch, we may have to load state_dict of the model and change then change the optimizer in the code.

In PytorchLightning, model state_dict, state of all optimizers, state of all learning rate schedulers etc. are automately saved in the lightning checkpoint. It seems that we will still have to load state_dict of the model from the checkpoint. (Similar issues also happen when we want to change the learning rate).

Is it possible that we are able to directly change the code and use a new optimizer/ new learning rate instead of recoding and reading the state_dict from checkpoint?

Pitch

Directly change the code and then a new optimizer/ new learning rate could be used.

Alternatives

Additional context

貢獻者指南