Unverified Commit 87ae2a46 authored by frankenliu's avatar frankenliu Committed by GitHub
Browse files

fix bug:divide by zero in _maybe_log_save_evaluate() (#28251)


Co-authored-by: default avatarliujizhong1 <liujizhong1@xiaomi.com>
parent 502a10a6
......@@ -2238,7 +2238,7 @@ class Trainer:
)
def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch, ignore_keys_for_eval):
if self.control.should_log:
if self.control.should_log and self.state.global_step > self._globalstep_last_logged:
if is_torch_tpu_available():
xm.mark_step()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment