未验证 提交 c86f79bd 编写于 作者: L liu zhengxi 提交者: GitHub

Transformer-XL update train (#5200)

* update train

* update eval
上级 7285e98c
...@@ -118,9 +118,9 @@ def do_eval(args): ...@@ -118,9 +118,9 @@ def do_eval(args):
logger_info = '' logger_info = ''
if valid_loss is not None: if valid_loss is not None:
logger_info = logger_info + _logger(valid_loss) logger_info = logger_info + _logger(valid_loss) + " | "
if test_loss is not None: if test_loss is not None:
logger_info = logger_info + _logger(test_loss) logger_info = logger_info + _logger(test_loss) + " | "
logger.info(logger_info) logger.info(logger_info)
......
...@@ -242,8 +242,9 @@ def do_train(args): ...@@ -242,8 +242,9 @@ def do_train(args):
logger.info(logger_info) logger.info(logger_info)
if args.save_model and rank == 0: if args.save_model and rank == 0:
model_dir = os.path.join(args.save_model, model_dir = os.path.join(
"step_" + str(step_idx)) args.save_model,
"step_" + str(step_idx) + "_" + str(eval_loss))
if not os.path.exists(model_dir): if not os.path.exists(model_dir):
os.makedirs(model_dir) os.makedirs(model_dir)
paddle.save( paddle.save(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册