Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Apr 14, 2020
1 parent ba59000 commit 83a0c1c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 69 deletions.
2 changes: 1 addition & 1 deletion tests/loggers/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import tests.base.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.loggers import (
TensorBoardLogger, MLFlowLogger, NeptuneLogger, TestTubeLogger, CometLogger, WandbLogger)
TensorBoardLogger, MLFlowLogger, NeptuneLogger, TestTubeLogger, CometLogger)
from tests.base import LightningTestModel


Expand Down
19 changes: 0 additions & 19 deletions tests/loggers/test_neptune.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pickle
from unittest.mock import patch, MagicMock

import torch
Expand Down Expand Up @@ -60,24 +59,6 @@ def test_neptune_additional_methods(neptune):
neptune.create_experiment().append_tags.assert_called_once_with('two', 'tags')


def test_neptune_pickle(tmpdir):
"""Verify that pickling trainer with neptune logger works."""
tutils.reset_seed()

logger = NeptuneLogger(offline_mode=True)

trainer_options = dict(
default_root_dir=tmpdir,
max_epochs=1,
logger=logger
)

trainer = Trainer(**trainer_options)
pkl_bytes = pickle.dumps(trainer)
trainer2 = pickle.loads(pkl_bytes)
trainer2.logger.log_metrics({'acc': 1.0})


def test_neptune_leave_open_experiment_after_fit(tmpdir):
"""Verify that neptune experiment was closed after training"""
tutils.reset_seed()
Expand Down
24 changes: 3 additions & 21 deletions tests/loggers/test_tensorboard.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import pickle
from argparse import Namespace

import pytest
import torch

from pytorch_lightning import Trainer
from pytorch_lightning.loggers import TensorBoardLogger


def test_tensorboard_pickle(tmpdir):
"""Verify that pickling trainer with Tensorboard logger works."""

logger = TensorBoardLogger(save_dir=tmpdir, name="tensorboard_pickle_test")

trainer_options = dict(max_epochs=1, logger=logger)

trainer = Trainer(**trainer_options)
pkl_bytes = pickle.dumps(trainer)
trainer2 = pickle.loads(pkl_bytes)
trainer2.logger.log_metrics({"acc": 1.0})


def test_tensorboard_automatic_versioning(tmpdir):
"""Verify that automatic versioning works"""

Expand Down Expand Up @@ -60,13 +45,10 @@ def test_tensorboard_named_version(tmpdir):
# in the "minimum requirements" test setup


def test_tensorboard_no_name(tmpdir):
@pytest.mark.parametrize("name", ['', None])
def test_tensorboard_no_name(tmpdir, name):
"""Verify that None or empty name works"""

logger = TensorBoardLogger(save_dir=tmpdir, name="")
assert logger.root_dir == tmpdir

logger = TensorBoardLogger(save_dir=tmpdir, name=None)
logger = TensorBoardLogger(save_dir=tmpdir, name=name)
assert logger.root_dir == tmpdir


Expand Down
28 changes: 0 additions & 28 deletions tests/loggers/test_test_tube.py

This file was deleted.

0 comments on commit 83a0c1c

Please sign in to comment.