Skip to content

Commit

Permalink
deprecate the TestTubeLogger (#9065)
Browse files Browse the repository at this point in the history
Co-authored-by: Kaushik B <45285388+kaushikb11@users.noreply.github.com>
  • Loading branch information
awaelchli and kaushikb11 authored Aug 26, 2021
1 parent 5c2b7ca commit 8efdeb2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,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
Expand Down
10 changes: 9 additions & 1 deletion pytorch_lightning/loggers/test_tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -36,6 +36,10 @@ class TestTubeLogger(LightningLoggerBase):
Log to local file system in `TensorBoard <https://www.tensorflow.org/tensorboard>`_ format
but using a nicer folder structure (see `full docs <https://williamfalcon.github.io/test-tube>`_).
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
Expand Down Expand Up @@ -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,"
Expand Down
8 changes: 8 additions & 0 deletions tests/deprecated_api/test_remove_1-7.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 8efdeb2

Please sign in to comment.