Skip to content

Commit

Permalink
Always save model at the end of training
Browse files Browse the repository at this point in the history
  • Loading branch information
vturrisi committed Jun 15, 2024
1 parent 0abeaab commit 3d58244
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion solo/utils/checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def on_train_start(self, trainer: pl.Trainer, _):
self.save_args(trainer)

def on_train_epoch_end(self, trainer: pl.Trainer, _):
"""Tries to save current checkpoint at the end of each train epoch.
"""Tries to save the current checkpoint at the end of each train epoch.
Args:
trainer (pl.Trainer): pytorch lightning trainer object.
Expand All @@ -173,3 +173,8 @@ def on_train_epoch_end(self, trainer: pl.Trainer, _):
epoch = trainer.current_epoch # type: ignore
if epoch % self.frequency == 0:
self.save(trainer)

def on_train_epoch_end(self, *args, **kwargs):
"""Saves model at the end of training. """

self.save(trainer)

0 comments on commit 3d58244

Please sign in to comment.