We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ae31cd commit 27bba1aCopy full SHA for 27bba1a
pytorch_lightning/trainer/training_loop.py
@@ -426,7 +426,9 @@ def run_training_epoch(self):
426
# logs user requested information to logger
427
self.log_metrics(batch_step_metrics, grad_norm_dic)
428
429
- self.global_step += 1
+ # progress global step according to grads progress
430
+ if (self.batch_idx + 1) % self.accumulate_grad_batches == 0:
431
+ self.global_step += 1
432
self.total_batch_idx += 1
433
434
# end epoch early
0 commit comments