Skip to content

Commit 10150fc

Browse files
authored
make progress bar match internal epoch counter (#3061)
* fix 3018, 3032 * changed progress bar for 3032
1 parent 7933a11 commit 10150fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytorch_lightning/callbacks/progress.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def total_val_batches(self) -> int:
113113
"""
114114
total_val_batches = 0
115115
if not self.trainer.disable_validation:
116-
is_val_epoch = (self.trainer.current_epoch + 1) % self.trainer.check_val_every_n_epoch == 0
116+
is_val_epoch = (self.trainer.current_epoch) % self.trainer.check_val_every_n_epoch == 0
117117
total_val_batches = sum(self.trainer.num_val_batches) if is_val_epoch else 0
118118
return total_val_batches
119119

@@ -330,7 +330,7 @@ def on_epoch_start(self, trainer, pl_module):
330330
total_batches = total_train_batches + total_val_batches
331331
if not self.main_progress_bar.disable:
332332
self.main_progress_bar.reset(convert_inf(total_batches))
333-
self.main_progress_bar.set_description(f'Epoch {trainer.current_epoch + 1}')
333+
self.main_progress_bar.set_description(f'Epoch {trainer.current_epoch}')
334334

335335
def on_train_batch_end(self, trainer, pl_module, batch, batch_idx, dataloader_idx):
336336
super().on_train_batch_end(trainer, pl_module, batch, batch_idx, dataloader_idx)

0 commit comments

Comments
 (0)