Skip to content

Commit

Permalink
Write date in checkpoint file (#5514)
Browse files Browse the repository at this point in the history
* write date in checkpoint file

write date in checkpoint file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* isoformat

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
  • Loading branch information
3 people authored Nov 5, 2021
1 parent 17b5f5b commit 99a45ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import sys
import time
from copy import deepcopy
from datetime import datetime
from pathlib import Path

import numpy as np
Expand Down Expand Up @@ -381,7 +382,8 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
'ema': deepcopy(ema.ema).half(),
'updates': ema.updates,
'optimizer': optimizer.state_dict(),
'wandb_id': loggers.wandb.wandb_run.id if loggers.wandb else None}
'wandb_id': loggers.wandb.wandb_run.id if loggers.wandb else None,
'date': datetime.now().isoformat()}

# Save last, best and delete
torch.save(ckpt, last)
Expand Down

0 comments on commit 99a45ba

Please sign in to comment.