From 0430067faf69c9b18063461efefec057dfaf3f3e Mon Sep 17 00:00:00 2001 From: FengZiYjun Date: Fri, 31 Aug 2018 11:51:56 +0800 Subject: [PATCH] update --- fastNLP/core/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/core/trainer.py b/fastNLP/core/trainer.py index a609caa3..7fc34da0 100644 --- a/fastNLP/core/trainer.py +++ b/fastNLP/core/trainer.py @@ -164,7 +164,7 @@ class BaseTrainer(object): self.grad_backward(loss) self.update() - if step % kwargs["n_print"] == 0: + if kwargs["n_print"] > 0 and step % kwargs["n_print"] == 0: end = time.time() diff = timedelta(seconds=round(end - kwargs["start"])) print_output = "[epoch: {:>3} step: {:>4}] train loss: {:>4.2} time: {}".format(