修复n_batches导致的bug

This commit is contained in:
yhcc 2022-06-03 22:35:46 +08:00
parent 745d254aa5
commit 82b06767f5

View File

@ -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,