Yonghye Kwon pre-commit-ci[bot] glenn-jocher commited on
Commit
99a45ba
1 Parent(s): 17b5f5b

Write date in checkpoint file (#5514)

Browse files

* 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 <glenn.jocher@ultralytics.com>

Files changed (1) hide show
  1. train.py +3 -1
train.py CHANGED
@@ -14,6 +14,7 @@ import random
14
  import sys
15
  import time
16
  from copy import deepcopy
 
17
  from pathlib import Path
18
 
19
  import numpy as np
@@ -381,7 +382,8 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
381
  'ema': deepcopy(ema.ema).half(),
382
  'updates': ema.updates,
383
  'optimizer': optimizer.state_dict(),
384
- 'wandb_id': loggers.wandb.wandb_run.id if loggers.wandb else None}
 
385
 
386
  # Save last, best and delete
387
  torch.save(ckpt, last)
 
14
  import sys
15
  import time
16
  from copy import deepcopy
17
+ from datetime import datetime
18
  from pathlib import Path
19
 
20
  import numpy as np
 
382
  'ema': deepcopy(ema.ema).half(),
383
  'updates': ema.updates,
384
  'optimizer': optimizer.state_dict(),
385
+ 'wandb_id': loggers.wandb.wandb_run.id if loggers.wandb else None,
386
+ 'date': datetime.now().isoformat()}
387
 
388
  # Save last, best and delete
389
  torch.save(ckpt, last)