From 99a45bad81535728be67c9871fd5513588d8d471 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Fri, 5 Nov 2021 19:48:10 +0900 Subject: [PATCH] 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 --- train.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index b57e8f7ba675..f827d985c801 100644 --- a/train.py +++ b/train.py @@ -14,6 +14,7 @@ import sys import time from copy import deepcopy +from datetime import datetime from pathlib import Path import numpy as np @@ -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)