Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion docs/source/trainer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,18 @@ You can override the default behavior by initializing the :class:`~pytorch_light
callback, and adding it to the :paramref:`~pytorch_lightning.trainer.trainer.Trainer.callbacks` list.
See :ref:`Saving and Loading Weights <weights_loading>` for how to customize checkpointing.

.. testcode::

from pytorch_lightning.callbacks import ModelCheckpoint
# Init ModelCheckpoint callback, monitoring 'val_loss'
checkpoint_callback = ModelCheckpoint(monitor='val_loss')

# Add your callback to the callbacks list
trainer = Trainer(callbacks=[checkpoint_callback])


.. warning:: Passing a ModelCheckpoint instance to this argument is deprecated since
v1.1.0 and will be unsupported from v1.3.0.
v1.1 and will be unsupported from v1.3. Use `callbacks` argument instead.


default_root_dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def configure_checkpoint_callbacks(self, checkpoint_callback: Union[ModelCheckpo
# TODO: deprecated, remove this block in v1.3.0
rank_zero_warn(
"Passing a ModelCheckpoint instance to Trainer(checkpoint_callbacks=...)"
" is deprecated since v1.1 and will no longer be supported in v1.3.",
" is deprecated since v1.1 and will no longer be supported in v1.3."
" Use `callbacks` argument instead.",
DeprecationWarning
)
self.trainer.callbacks.append(checkpoint_callback)
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __init__(
:paramref:`~pytorch_lightning.trainer.trainer.Trainer.callbacks`. Default: ``True``.

.. warning:: Passing a ModelCheckpoint instance to this argument is deprecated since
v1.1.0 and will be unsupported from v1.3.0.
v1.1 and will be unsupported from v1.3. Use `callbacks` argument instead.

check_val_every_n_epoch: Check val every n train epochs.

Expand Down