From dfb6d3626eaa9ffaee7fe09c37659b9f21dfa6a0 Mon Sep 17 00:00:00 2001 From: Nic Eggert Date: Tue, 21 Jan 2020 13:26:43 -0600 Subject: [PATCH] Fix failing GPU tests (#722) * Fix distributed_backend=None test We now throw a warning instead of an exception. Update test to reflect this. * Fix test_tube logger close when debug=True --- pytorch_lightning/logging/test_tube.py | 5 +++-- tests/test_gpu_models.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pytorch_lightning/logging/test_tube.py b/pytorch_lightning/logging/test_tube.py index ccb50ef3..c1ebc8ca 100644 --- a/pytorch_lightning/logging/test_tube.py +++ b/pytorch_lightning/logging/test_tube.py @@ -135,8 +135,9 @@ class TestTubeLogger(LightningLoggerBase): def close(self): # TODO: HACK figure out where this is being set to true self.experiment.debug = self.debug - exp = self.experiment - exp.close() + if not self.debug: + exp = self.experiment + exp.close() @property def rank(self): diff --git a/tests/test_gpu_models.py b/tests/test_gpu_models.py index 46089661..ec7f36e8 100644 --- a/tests/test_gpu_models.py +++ b/tests/test_gpu_models.py @@ -183,7 +183,7 @@ def test_multi_gpu_none_backend(tmpdir): gpus='-1' ) - with pytest.raises(MisconfigurationException): + with pytest.warns(UserWarning): tutils.run_model_test(trainer_options, model)