From 2180aa19ad2a1fc70e217a19964592d1bc7db62e Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Wed, 22 Apr 2020 16:13:55 +0200 Subject: [PATCH] Remove warning (#1634) Remove warning Update CHANGELOG.md --- .github/workflows/ci-testing.yml | 3 ++- CHANGELOG.md | 2 ++ pytorch_lightning/__init__.py | 2 +- pytorch_lightning/trainer/training_loop.py | 3 --- tests/trainer/test_trainer.py | 9 +++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 36e49e0e..7426a229 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -1,6 +1,6 @@ name: CI testing -# https://help.github.com/en/actions/reference/events-that-trigger-workflows +# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows on: # Trigger the workflow on push or pull request, # but only for the master branch @@ -116,6 +116,7 @@ jobs: python setup.py check --metadata --strict python setup.py sdist twine check dist/* + #- name: Try install package # if: ! startsWith(matrix.os, 'windows') # run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b8e2f29..9aff6450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Removed +- Removed Warning from trainer loop ([#1634](https://github.com/PyTorchLightning/pytorch-lightning/pull/1634)) + ### Fixed diff --git a/pytorch_lightning/__init__.py b/pytorch_lightning/__init__.py index 1aa8eb23..2a656ce2 100644 --- a/pytorch_lightning/__init__.py +++ b/pytorch_lightning/__init__.py @@ -1,6 +1,6 @@ """Root package info.""" -__version__ = '0.7.4' +__version__ = '0.7.5rc1' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' diff --git a/pytorch_lightning/trainer/training_loop.py b/pytorch_lightning/trainer/training_loop.py index 8697270c..37bac3d9 100644 --- a/pytorch_lightning/trainer/training_loop.py +++ b/pytorch_lightning/trainer/training_loop.py @@ -299,9 +299,6 @@ class TrainerTrainLoopMixin(ABC): """Warning: this is just empty shell for code implemented in other class.""" def train(self): - rank_zero_warn('Displayed epoch numbers in the progress bar start from "1" until v0.6.x,' - ' but will start from "0" in v0.8.0.', RuntimeWarning) - # get model model = self.get_model() diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 6876a693..5edf017c 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -120,12 +120,13 @@ def test_no_val_end_module(tmpdir): new_weights_path = os.path.join(tmpdir, 'save_test.ckpt') trainer.save_checkpoint(new_weights_path) - # load new model - tags_path = tutils.get_data_path(logger, path_dir=tmpdir) - tags_path = os.path.join(tags_path, 'meta_tags.csv') + # assert ckpt has hparams + ckpt = torch.load(new_weights_path) + assert 'hparams' in ckpt.keys(), 'hparams missing from checkpoints' + + # won't load without hparams in the ckpt model_2 = LightningTestModel.load_from_checkpoint( checkpoint_path=new_weights_path, - tags_csv=tags_path ) model_2.eval()