Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifact-based Checkpoint Storage #1

Merged
merged 7 commits into from
Feb 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ipdated checkpoint system
  • Loading branch information
soumik12345 committed Feb 23, 2022
commit 9522109a7536d989e5d427c06a9fda394835ffb9
2 changes: 2 additions & 0 deletions elegy/callbacks/wandb_callback.py
Original file line number Diff line number Diff line change
@@ -157,10 +157,12 @@ def on_epoch_end(self, epoch: int, logs=None):

if self._mode == "min" and logs[self._monitor] < self._monitor_metric_val:
self._model_path = f"model-best-{epoch + 1}-{self.run.name}"
print(f"{self._monitor} decreased at epoch {epoch}. Saving Model at {self._model_path}")
self.model.save(self._model_path)
self._monitor_metric_val = logs[self._monitor]
elif self._mode == "max" and logs[self._monitor] > self._monitor_metric_val:
self._model_path = f"model-best-{epoch + 1}-{self.run.name}"
print(f"{self._monitor} increased at epoch {epoch}. Saving Model at {self._model_path}")
self.model.save(self._model_path)
self._monitor_metric_val = logs[self._monitor]