Skip to content

Commit

Permalink
BUG: Use ISO 8601 timestamp for model checkpoint paths
Browse files Browse the repository at this point in the history
Closes #21

Co-Authored-By: Ghislain Vaillant <[email protected]>
  • Loading branch information
DrFabach and ghisvail committed Feb 20, 2024
1 parent 12f6cd7 commit ec956ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions medkit/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ def save(self, epoch: int) -> str:
str
Path of the checkpoint saved
"""
current_date = datetime.datetime.now().strftime("%d-%m-%Y_%H:%M")
name = f"checkpoint_{epoch:03d}_{current_date}"
timestamp = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")
name = f"checkpoint_{epoch:03d}_{timestamp}"

checkpoint_dir = Path(self.output_dir) / name
self.callback.on_save(checkpoint_dir=str(checkpoint_dir))
Expand Down

0 comments on commit ec956ec

Please sign in to comment.