Save checkpoints without overwrite #11087
Answered
by
rohitgr7
mcomunita
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
Hi there, I am using the ModelCheckpoint callback to save my model every n epochs but I cannot find a way to prevent PL from overwriting/deleting the previous checkpoint. Ideally, I would like to keep the default naming convention {epoch}-{step} but without losing previous checkpoints. Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
rohitgr7
Dec 16, 2021
Replies: 1 comment 1 reply
-
you can create a custom ModelCheckpoint instance with ckpt_callback = ModelCheckpoint(save_top_k=-1, ...)
trainer = Trainer(callbacks=[ckpt_callback], ...) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mcomunita
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can create a custom ModelCheckpoint instance with
save_top_k=-1
and pass it in inside Trainer callbacks.