diff --git a/CHANGELOG.md b/CHANGELOG.md index 5232cc793163f..1a7cbd2e9993a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -147,7 +147,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Deprecated `DataModule` properties: `train_transforms`, `val_transforms`, `test_transforms`, `size`, `dims` ([#8851](https://github.com/PyTorchLightning/pytorch-lightning/pull/8851)) -- Deprecated `prepare_data_per_node` flag on Trainer and set it as a property of `DataHooks`, accessible in the `LightningModule` and `LightningDataModule` [#8958](https://github.com/PyTorchLightning/pytorch-lightning/pull/8958) +- Deprecated `prepare_data_per_node` flag on Trainer and set it as a property of `DataHooks`, accessible in the `LightningModule` and `LightningDataModule` ([#8958](https://github.com/PyTorchLightning/pytorch-lightning/pull/8958)) + + +- Deprecated the `TestTubeLogger` ([#9065](https://github.com/PyTorchLightning/pytorch-lightning/pull/9065)) ### Removed diff --git a/pytorch_lightning/loggers/test_tube.py b/pytorch_lightning/loggers/test_tube.py index bbe4897b47528..9a3b6ccee64df 100644 --- a/pytorch_lightning/loggers/test_tube.py +++ b/pytorch_lightning/loggers/test_tube.py @@ -20,7 +20,7 @@ import pytorch_lightning as pl from pytorch_lightning.loggers.base import LightningLoggerBase, rank_zero_experiment -from pytorch_lightning.utilities import _module_available, rank_zero_warn +from pytorch_lightning.utilities import _module_available, rank_zero_deprecation, rank_zero_warn from pytorch_lightning.utilities.distributed import rank_zero_only _TESTTUBE_AVAILABLE = _module_available("test_tube") @@ -36,6 +36,10 @@ class TestTubeLogger(LightningLoggerBase): Log to local file system in `TensorBoard `_ format but using a nicer folder structure (see `full docs `_). + Warning: + The test-tube package is no longer maintained and PyTorch Lightning will remove the :class:´TestTubeLogger´ + in v1.7.0. + Install it with pip: .. code-block:: bash @@ -97,6 +101,10 @@ def __init__( log_graph: bool = False, prefix: str = "", ): + rank_zero_deprecation( + "The TestTubeLogger is deprecated since v1.5 and will be removed in v1.7. We recommend switching to the" + " `pytorch_lightning.loggers.TensorBoardLogger` as an alternative." + ) if Experiment is None: raise ImportError( "You want to use `test_tube` logger which is not installed yet," diff --git a/tests/deprecated_api/test_remove_1-7.py b/tests/deprecated_api/test_remove_1-7.py index 7581bf2b0c142..ae8f9e1dcc53d 100644 --- a/tests/deprecated_api/test_remove_1-7.py +++ b/tests/deprecated_api/test_remove_1-7.py @@ -12,10 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Test deprecated functionality which will be removed in v1.7.0 """ +from unittest import mock import pytest from pytorch_lightning import LightningDataModule, Trainer +from pytorch_lightning.loggers import TestTubeLogger from tests.deprecated_api import _soft_unimport_module from tests.helpers import BoringModel from tests.helpers.datamodules import MNISTDataModule @@ -87,3 +89,9 @@ def test_v1_7_0_trainer_prepare_data_per_node(tmpdir): match="Setting `prepare_data_per_node` with the trainer flag is deprecated and will be removed in v1.7.0!" ): _ = Trainer(prepare_data_per_node=False) + + +@mock.patch("pytorch_lightning.loggers.test_tube.Experiment") +def test_v1_7_0_test_tube_logger(_, tmpdir): + with pytest.deprecated_call(match="The TestTubeLogger is deprecated since v1.5 and will be removed in v1.7"): + _ = TestTubeLogger(tmpdir)