Write date in checkpoint file (#5514)
* 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>
This commit is contained in:
parent
17b5f5b974
commit
99a45bad81
4
train.py
4
train.py
|
|
@ -14,6 +14,7 @@ import random
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
@ -381,7 +382,8 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
|
||||||
'ema': deepcopy(ema.ema).half(),
|
'ema': deepcopy(ema.ema).half(),
|
||||||
'updates': ema.updates,
|
'updates': ema.updates,
|
||||||
'optimizer': optimizer.state_dict(),
|
'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
|
# Save last, best and delete
|
||||||
torch.save(ckpt, last)
|
torch.save(ckpt, last)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue