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

Prune deprecated Trainer(checkpoint_callback=ModelCheckpoint()) #6166

Merged
merged 6 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Removed


- Removed passing a `ModelCheckpoint` instance to `Trainer(checkpoint_callback)` ([#6165](https://github.com/PyTorchLightning/pytorch-lightning/pull/6165))
carmocca marked this conversation as resolved.
Show resolved Hide resolved


### Fixed

- Fixed incorrect yield logic for the amp autocast context manager ([#6080](https://github.com/PyTorchLightning/pytorch-lightning/pull/6080))
Expand Down
9 changes: 0 additions & 9 deletions pytorch_lightning/trainer/connectors/callback_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ def on_trainer_init(
self.trainer.callbacks = self._reorder_callbacks(self.trainer.callbacks)

def configure_checkpoint_callbacks(self, checkpoint_callback: Union[ModelCheckpoint, bool]):
if isinstance(checkpoint_callback, ModelCheckpoint):
# 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."
" Use `callbacks` argument instead.", DeprecationWarning
)
self.trainer.callbacks.append(checkpoint_callback)

if self._trainer_has_checkpoint_callbacks() and checkpoint_callback is False:
raise MisconfigurationException(
"Trainer was configured with checkpoint_callback=False but found ModelCheckpoint"
Expand Down
3 changes: 0 additions & 3 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ def __init__(
It will configure a default ModelCheckpoint callback if there is no user-defined ModelCheckpoint in
:paramref:`~pytorch_lightning.trainer.trainer.Trainer.callbacks`. Default: ``True``.

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

check_val_every_n_epoch: Check val every n train epochs.

default_root_dir: Default path for logs and weights when no logger/ckpt_callback passed.
Expand Down