Skip to content

Commit 1fc8ae7

Browse files
committed
CURRENT STASH - REVERT THIS
1 parent 62ae3ea commit 1fc8ae7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

pytorch_lightning/loops/epoch/training_epoch_loop.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ def on_run_end(self) -> None:
298298
if self._num_ready_batches_reached():
299299
self.update_lr_schedulers("epoch", update_plateau_schedulers=True)
300300

301+
# FIXME: where should this go...
302+
# self.batch_progress.current.reset()
303+
301304
# if fault tolerant is enabled and process has been notified, exit.
302305
self.trainer._exit_gracefully_on_signal()
303306

pytorch_lightning/loops/fit_loop.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FitLoop(Loop):
3636

3737
def __init__(
3838
self,
39-
min_epochs: Optional[int] = 1,
39+
min_epochs: Optional[int] = 0,
4040
max_epochs: int = 1000,
4141
) -> None:
4242
super().__init__()
@@ -239,7 +239,9 @@ def advance(self) -> None:
239239
self.global_step += 1
240240

241241
def on_advance_end(self) -> None:
242-
self.epoch_progress.increment_completed()
242+
# TODO(@carmocca): remove this check after implementing `loop.stop()`
243+
if not self.trainer.should_stop:
244+
self.epoch_progress.increment_completed()
243245

244246
def on_run_end(self) -> None:
245247
"""Calls the ``on_train_end`` hook."""

pytorch_lightning/trainer/trainer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def __init__(
321321
To enable infinite training, set ``max_epochs = -1``.
322322
323323
min_epochs: Force training for at least these many epochs. Disabled by default (None).
324-
If both min_epochs and min_steps are not specified, defaults to ``min_epochs = 1``.
324+
If both min_epochs and min_steps are not specified, defaults to ``min_epochs = 0``.
325325
326326
max_steps: Stop training after this number of steps. Disabled by default (-1). If ``max_steps = -1``
327327
and ``max_epochs = None``, will default to ``max_epochs = 1000``. To enable infinite training, set
@@ -447,7 +447,7 @@ def __init__(
447447
self.tuner = Tuner(self)
448448

449449
fit_loop = FitLoop(
450-
min_epochs=(1 if (min_epochs is None and min_steps is None and max_time is None) else min_epochs),
450+
min_epochs=(0 if (min_epochs is None and min_steps is None and max_time is None) else min_epochs),
451451
max_epochs=(
452452
max_epochs if max_epochs is not None else (1000 if (max_steps == -1 and max_time is None) else -1)
453453
),

0 commit comments

Comments
 (0)