Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation for every_n_epochs parameter of ModelCheckpoint #10421

Merged
merged 2 commits into from
Nov 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,14 @@ class ModelCheckpoint(Callback):
guaranteed to execute at the exact time specified, but should be close.
This must be mutually exclusive with ``every_n_train_steps`` and ``every_n_epochs``.
every_n_epochs: Number of epochs between checkpoints.
If ``every_n_epochs == None or every_n_epochs == 0``, we skip saving when the epoch ends.
To disable, set ``every_n_epochs = 0``. This value must be ``None`` or non-negative.
This value must be ``None`` or non-negative.
To disable saving after each epoch, set ``every_n_epochs = 0``.
If all of ``every_n_epochs``, ``every_n_train_steps`` and
``train_time_interval`` are ``None``, we save a checkpoint at the end of every epoch
(equivalent to ``every_n_epochs = 1``).
If ``every_n_epochs == None`` and either ``every_n_train_steps != None`` or ``train_time_interval != None``,
saving at the end of each epoch is disabled
(equivalent to ``every_n_epochs = 0``).
This must be mutually exclusive with ``every_n_train_steps`` and ``train_time_interval``.
Setting both ``ModelCheckpoint(..., every_n_epochs=V, save_on_train_epoch_end=False)`` and
``Trainer(max_epochs=N, check_val_every_n_epoch=M)``
Expand Down