提交 676d160d 编写于 作者: H Hui Zhang

more resume ckpt info

上级 daaa72a6
...@@ -184,11 +184,13 @@ class Trainer(): ...@@ -184,11 +184,13 @@ class Trainer():
self.iteration = infos["step"] self.iteration = infos["step"]
self.epoch = infos["epoch"] self.epoch = infos["epoch"]
scratch = False scratch = False
logger.info(
f"Restore ckpt: epoch {self.epoch }, step {self.iteration}!")
else: else:
self.iteration = 0 self.iteration = 0
self.epoch = 0 self.epoch = 0
scratch = True scratch = True
logger.info("Restore/Init checkpoint!") logger.info("Init from scratch!")
return scratch return scratch
def maybe_batch_sampler_step(self): def maybe_batch_sampler_step(self):
...@@ -207,6 +209,8 @@ class Trainer(): ...@@ -207,6 +209,8 @@ class Trainer():
# resume: train next_epoch and next_iteration # resume: train next_epoch and next_iteration
self.epoch += 1 self.epoch += 1
self.iteration += 1 self.iteration += 1
logger.info(
f"Resume train: epoch {self.epoch }, step {self.iteration}!")
self.maybe_batch_sampler_step() self.maybe_batch_sampler_step()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册