From add9faa8226091bc1f89b472fe0fb3815b382289 Mon Sep 17 00:00:00 2001 From: tingquangao Date: Wed, 24 Feb 2021 07:42:20 +0000 Subject: [PATCH] Fix the log about length of valid_dataloader --- tools/train.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/train.py b/tools/train.py index fab10b64..c12cf005 100755 --- a/tools/train.py +++ b/tools/train.py @@ -89,8 +89,10 @@ def main(config, device, logger, vdl_writer): # load pretrain model pre_best_model_dict = init_model(config, model, logger, optimizer) - logger.info('train dataloader has {} iters, valid dataloader has {} iters'. - format(len(train_dataloader), len(valid_dataloader))) + logger.info('train dataloader has {} iters'.format(len(train_dataloader))) + if valid_dataloader is not None: + logger.info('valid dataloader has {} iters'.format( + len(valid_dataloader))) # start train program.train(config, train_dataloader, valid_dataloader, device, model, loss_class, optimizer, lr_scheduler, post_process_class, -- GitLab