From 0bcf2388b1888f6c91285e439d7dc2313a9eca78 Mon Sep 17 00:00:00 2001 From: dxqb <183307934+dxqb@users.noreply.github.com> Date: Mon, 20 Jul 2026 21:11:36 +0200 Subject: [PATCH] Show absolute epoch number in resume progress bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The epoch progress bar iterated `range(resume_epoch, total_epochs)` with no `initial`/`total`, so on resume it showed the count of *remaining* epochs starting from 0 (e.g. `1/50`) instead of the absolute position (`51/100`). This adds `initial=train_progress.epoch, total=self.config.epochs`, matching how the step bar just below it already resumes. Cosmetic only — `train_progress.epoch` and the LR schedule were already correct; this only fixes the display. Surfaced while investigating Nerogar/OneTrainer#1604. --- modules/trainer/GenericTrainer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/trainer/GenericTrainer.py b/modules/trainer/GenericTrainer.py index dd17ad76e..6d17f561c 100644 --- a/modules/trainer/GenericTrainer.py +++ b/modules/trainer/GenericTrainer.py @@ -635,7 +635,9 @@ def train(self): ema_loss_steps = 0 epochs = range(train_progress.epoch, self.config.epochs, 1) - for _epoch in tqdm(epochs, desc="epoch") if multi.is_master() else epochs: + if multi.is_master(): + epochs = tqdm(epochs, desc="epoch", initial=train_progress.epoch, total=self.config.epochs) + for _epoch in epochs: multi.sync_commands(self.commands) if self.commands.get_stop_command(): return