Skip to content

Remove deprecated trainer.verbose_evaluate #14884

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

Merged
merged 4 commits into from
Sep 24, 2022
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
5 changes: 5 additions & 0 deletions src/pytorch_lightning/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Removed the deprecated `SimpleProfiler.profile_iterable` and `AdvancedProfiler.profile_iterable` attributes ([#14864](https://github.com/Lightning-AI/lightning/pull/14864))


- Removed the deprecated `Trainer.verbose_evaluate` ([#14884](https://github.com/Lightning-AI/lightning/pull/14884))


- Remove the deprecated `Trainer.should_rank_save_checkpoint` ([#14885](https://github.com/Lightning-AI/lightning/pull/14885))


### Fixed

- Fixed an issue with `LightningLite.setup()` not setting the `.device` attribute correctly on the returned wrapper ([#14822](https://github.com/Lightning-AI/lightning/pull/14822))
Expand Down
20 changes: 0 additions & 20 deletions src/pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2228,26 +2228,6 @@ def predict_loop(self, loop: PredictionLoop):
loop.trainer = self
self._predict_loop = loop

@property
def verbose_evaluate(self) -> bool:
rank_zero_deprecation(
"The `Trainer.verbose_evaluate` property has been deprecated and will be removed in v1.8. The current value"
" returned is the union of the validate and test loop values. You can choose which one to access with"
" `trainer.{validate,test}_loop.verbose`.",
stacklevel=5,
)
return self.validate_loop.verbose or self.test_loop.verbose

@verbose_evaluate.setter
def verbose_evaluate(self, verbose: bool) -> None:
rank_zero_deprecation(
"The `Trainer.verbose_evaluate` property has been deprecated and will be removed in v1.8. This will set"
" the value for both trainer.{validate,test}_loop.verbose`.",
stacklevel=5,
)
self.validate_loop.verbose = verbose
self.test_loop.verbose = verbose

@property
def _evaluation_loop(self) -> EvaluationLoop:
if self.state.fn in (TrainerFn.FITTING, TrainerFn.TUNING):
Expand Down
9 changes: 0 additions & 9 deletions tests/tests_pytorch/deprecated_api/test_remove_1-8.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@ def test_v1_8_0_deprecated_call_hook():
trainer.call_hook("test_hook")


def test_v1_8_0_trainer_verbose_evaluate():
trainer = Trainer()
with pytest.deprecated_call(match="verbose_evaluate` property has been deprecated and will be removed in v1.8"):
assert trainer.verbose_evaluate

with pytest.deprecated_call(match="verbose_evaluate` property has been deprecated and will be removed in v1.8"):
trainer.verbose_evaluate = False


@pytest.mark.parametrize("fn_prefix", ["validated", "tested", "predicted"])
def test_v1_8_0_trainer_ckpt_path_attributes(fn_prefix: str):
test_attr = f"{fn_prefix}_ckpt_path"
Expand Down