From 38eff991e543e78a55b33e447f47f5e34b9d4cbb Mon Sep 17 00:00:00 2001 From: ylfeng Date: Mon, 7 Dec 2020 21:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20log=5Fdir=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ltp/utils/common_train.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ltp/utils/common_train.py b/ltp/utils/common_train.py index c727bef38..23bd43dad 100644 --- a/ltp/utils/common_train.py +++ b/ltp/utils/common_train.py @@ -1,7 +1,4 @@ -import os import time -import torch -import argparse import pytorch_lightning as pl from pytorch_lightning import Trainer, loggers from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping @@ -18,7 +15,7 @@ def common_train(args, metric, model_class, build_method, task: str, **model_kwa ) model = model_class(args, **model_kwargs) build_method(model) - this_time = time.strftime("%m-%d_%H-%M-%S", time.localtime()) + this_time = time.strftime("%m-%d_%H:%M:%S", time.localtime()) logger = loggers.TensorBoardLogger(save_dir='lightning_logs', name=f'{task}_{this_time}') trainer: Trainer = Trainer.from_argparse_args( args,