Skip to content

Commit

Permalink
更新 log_dir 文件名格式
Browse files Browse the repository at this point in the history
  • Loading branch information
AlongWY committed Dec 7, 2020
1 parent 54abda2 commit 38eff99
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ltp/utils/common_train.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 38eff99

Please sign in to comment.