From 82b06767f55307143f6ed0e1a1400a8ee339a3cf Mon Sep 17 00:00:00 2001 From: yhcc Date: Fri, 3 Jun 2022 22:35:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dn=5Fbatches=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/controllers/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/core/controllers/trainer.py b/fastNLP/core/controllers/trainer.py index 7c6bba53..41fca6ba 100644 --- a/fastNLP/core/controllers/trainer.py +++ b/fastNLP/core/controllers/trainer.py @@ -448,7 +448,7 @@ class Trainer(TrainerEventTrigger): # 初始化 state,包括提供给用户的接口和我们自己使用的接口; self.state = State() self.trainer_state = TrainerState( - n_epochs=n_epochs if n_batches!=-1 else None, + n_epochs=n_epochs if n_batches==-1 else None, cur_epoch_idx=0, global_forward_batches=0, batch_idx_in_epoch=0,