Skip to content

Commit 0a7eec8

Browse files
DrFabachghisvail
andcommitted
BUG: Use ISO 8601 timestamp for model checkpoint paths
Closes #21 Co-Authored-By: Ghislain Vaillant <[email protected]>
1 parent 7042cd2 commit 0a7eec8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

medkit/training/trainer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ def save(self, epoch: int) -> str:
312312
str
313313
Path of the checkpoint saved
314314
"""
315-
current_date = datetime.datetime.now().strftime("%d-%m-%Y_%H:%M")
316-
name = f"checkpoint_{epoch:03d}_{current_date}"
315+
timestamp = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")
316+
name = f"checkpoint_{epoch:03d}_{timestamp}"
317317

318318
checkpoint_dir = Path(self.output_dir) / name
319319
self.callback.on_save(checkpoint_dir=str(checkpoint_dir))

0 commit comments

Comments
 (0)