From dc2096c0e415b93d1a22622239b23af3c74fe728 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 26 Apr 2020 12:49:43 -0400 Subject: [PATCH 01/42] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 30ecaa48..65035e45 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![codecov](https://codecov.io/gh/PyTorchLightning/pytorch-lightning/branch/master/graph/badge.svg)](https://codecov.io/gh/PyTorchLightning/pytorch-lightning) [![CodeFactor](https://www.codefactor.io/repository/github/pytorchlightning/pytorch-lightning/badge)](https://www.codefactor.io/repository/github/pytorchlightning/pytorch-lightning) -[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=0.7.4)](https://pytorch-lightning.readthedocs.io/en/0.7.4/) +[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=0.7.4)](https://pytorch-lightning.readthedocs.io/en/latest/) [![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/pytorch-lightning/shared_invite/enQtODU5ODIyNTUzODQwLTFkMDg5Mzc1MDBmNjEzMDgxOTVmYTdhYjA1MDdmODUyOTg2OGQ1ZWZkYTQzODhhNzdhZDA3YmNhMDhlMDY4YzQ) [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/PytorchLightning/pytorch-lightning/blob/master/LICENSE) [![Next Release](https://img.shields.io/badge/Next%20Release-May%2006-.svg)](https://shields.io/) From 9f52e00bb4a48b033d50f2eb3fffb52c734e9ca6 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Wed, 22 Apr 2020 16:13:55 +0200 Subject: [PATCH 02/42] spec cache --- .github/workflows/ci-testing.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 4f94ba04..95db085c 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -67,15 +67,8 @@ jobs: # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - ${{ runner.os }}-${{ matrix.python-version }}- - - - name: Cache datasets - uses: actions/cache@v1 - with: - path: tests/Datasets # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: mnist-dataset + ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} + ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} - name: Install dependencies run: | @@ -88,6 +81,13 @@ jobs: pip list shell: bash + - name: Cache datasets + uses: actions/cache@v1 + with: + path: tests/Datasets # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: mnist-dataset + - name: Tests # env: # TOXENV: py${{ matrix.python-version }} From ea5e51c330349bd7db4f953618199fa47ae8961e Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Wed, 22 Apr 2020 16:31:11 +0200 Subject: [PATCH 03/42] spec cache --- .github/workflows/ci-testing.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 95db085c..a0da0b4a 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -60,15 +60,20 @@ jobs: python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" + # Note: This uses an internal pip API and may not always work + # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow + - name: Get pip cache + id: pip-cache + run: | + python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" + - name: Cache pip - uses: actions/cache@v1 + - uses: actions/cache@v1 with: - path: ~/.cache/pip # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} - ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} + ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip- - name: Install dependencies run: | From f08399527929ad7cd4316c7fb915f9f454a5aef9 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Wed, 22 Apr 2020 18:44:51 +0200 Subject: [PATCH 04/42] trigger --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index a0da0b4a..2cfe662c 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 From c13da418b54ed647ee432e973f8e688b595edc1b Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 21:14:41 +0200 Subject: [PATCH 05/42] extras --- .github/workflows/ci-testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 2cfe662c..d5584198 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -71,9 +71,9 @@ jobs: - uses: actions/cache@v1 with: path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}-pip- + ${{ runner.os }}-${{ matrix.python-version }}-pip- - name: Install dependencies run: | From e8024b0925e3a13b1b0a6b2edab8ba707c09ac05 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 21:19:45 +0200 Subject: [PATCH 06/42] checkout --- .github/workflows/docker_builds.yml | 2 +- .github/workflows/pypi-release.yml | 2 +- .github/workflows/rebase.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_builds.yml b/.github/workflows/docker_builds.yml index 9ba099e5..8732a14e 100644 --- a/.github/workflows/docker_builds.yml +++ b/.github/workflows/docker_builds.yml @@ -19,7 +19,7 @@ jobs: if: contains(github.ref, 'refs/tags/') id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - uses: actions/checkout@2.14 + - uses: actions/checkout@v2 - name: Publish Releases to Docker # only on releases uses: elgohr/Publish-Docker-Github-Action@master diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 96535064..4283aec1 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Set up Python 3.7 uses: actions/setup-python@v1 with: diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 3db59b60..2f259816 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -10,7 +10,7 @@ jobs: if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Automatic Rebase From b989756c07a34ff5ddad865eecab11ac90195de9 Mon Sep 17 00:00:00 2001 From: Peter Yu <2057325+yukw777@users.noreply.github.com> Date: Sun, 26 Apr 2020 16:10:58 -0400 Subject: [PATCH 07/42] pin actions/checkout version to v2 (#1617) --- .github/workflows/docker_builds.yml | 12 +++++------- .github/workflows/pypi-release.yml | 4 ++-- .github/workflows/rebase.yml | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker_builds.yml b/.github/workflows/docker_builds.yml index 9ba099e5..1ac289ba 100644 --- a/.github/workflows/docker_builds.yml +++ b/.github/workflows/docker_builds.yml @@ -1,10 +1,10 @@ name: Publish Docker on: - push: + push: branches: - - master - release: - types: + - master + release: + types: - created jobs: @@ -19,7 +19,7 @@ jobs: if: contains(github.ref, 'refs/tags/') id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - uses: actions/checkout@2.14 + - uses: actions/checkout@v2 - name: Publish Releases to Docker # only on releases uses: elgohr/Publish-Docker-Github-Action@master @@ -42,5 +42,3 @@ jobs: dockerfile: docker/Dockerfile buildargs: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.VERSION }} tags: "latest_py${{ matrix.python_version }}_torch${{ matrix.pytorch_version }}" - - diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 96535064..041f67bc 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Set up Python 3.7 uses: actions/setup-python@v1 with: @@ -30,7 +30,7 @@ jobs: - name: Build run: >- python setup.py sdist bdist_wheel - + # We do this, since failures on test.pypi aren't that bad - name: Publish to Test PyPI if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 3db59b60..2aa94bea 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -10,7 +10,7 @@ jobs: if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Automatic Rebase @@ -23,4 +23,4 @@ jobs: runs-on: ubuntu-latest steps: - name: Always run - run: echo "This job is used to prevent the workflow to fail when all other jobs are skipped." \ No newline at end of file + run: echo "This job is used to prevent the workflow to fail when all other jobs are skipped." From 80df5039f896afbfb178108650a4c0a7eebd7005 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Sun, 26 Apr 2020 22:11:22 +0200 Subject: [PATCH 08/42] changelog (#1616) * changelog * warning * pull * typo * typo --- CHANGELOG.md | 86 +++++++------------ .../gradient_accumulation_scheduler.py | 7 +- 2 files changed, 36 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61eeb435..5b8e2f29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,86 +8,66 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added -- Added flag `replace_sampler_ddp` to manually disaple sampler replacement in ddp ([#1513](https://github.com/PyTorchLightning/pytorch-lightning/pull/1513)) +### Changed +### Deprecated + +### Removed + +### Fixed + + +## [0.7.4] - 2020-04-26 + +### Added + +- Added flag `replace_sampler_ddp` to manually disable sampler replacement in DDP ([#1513](https://github.com/PyTorchLightning/pytorch-lightning/pull/1513)) - Added speed parity tests (max 1 sec difference per epoch)([#1482](https://github.com/PyTorchLightning/pytorch-lightning/pull/1482)) - - Added `auto_select_gpus` flag to trainer that enables automatic selection of available GPUs on exclusive mode systems. - -- Added learining rate finder ([#1347](https://github.com/PyTorchLightning/pytorch-lightning/pull/1347)) - -- Added support for ddp mode in clusters without SLURM ([#1345](https://github.com/PyTorchLightning/pytorch-lightning/issues/1345)) - -- Added `test_dataloaders` parameter to `Trainer.test()` ([#1393](https://github.com/PyTorchLightning/pytorch-lightning/issues/1393)) - +- Added learning rate finder ([#1347](https://github.com/PyTorchLightning/pytorch-lightning/pull/1347)) +- Added support for ddp mode in clusters without SLURM ([#1387](https://github.com/PyTorchLightning/pytorch-lightning/pull/1387)) +- Added `test_dataloaders` parameter to `Trainer.test()` ([#1434](https://github.com/PyTorchLightning/pytorch-lightning/pull/1434)) - Added `terminate_on_nan` flag to trainer that performs a NaN check with each training iteration when set to `True` ([#1475](https://github.com/PyTorchLightning/pytorch-lightning/pull/1475)) - - Added speed parity tests (max 1 sec difference per epoch)([#1482](https://github.com/PyTorchLightning/pytorch-lightning/pull/1482)) - - Added `terminate_on_nan` flag to trainer that performs a NaN check with each training iteration when set to `True`. ([#1475](https://github.com/PyTorchLightning/pytorch-lightning/pull/1475)) - - Added `ddp_cpu` backend for testing ddp without GPUs ([#1158](https://github.com/PyTorchLightning/pytorch-lightning/pull/1158)) - - Added [Horovod](http://horovod.ai) support as a distributed backend `Trainer(distributed_backend='horovod')` ([#1529](https://github.com/PyTorchLightning/pytorch-lightning/pull/1529)) - - Added support for 8 core distributed training on Kaggle TPU's ([#1568](https://github.com/PyTorchLightning/pytorch-lightning/pull/1568)) - - Added support for native AMP ([#1561](https://github.com/PyTorchLightning/pytorch-lightning/pull/1561), [#1580](https://github.com/PyTorchLightning/pytorch-lightning/pull/1580)) ### Changed - Changed the default behaviour to no longer include a NaN check with each training iteration. ([#1475](https://github.com/PyTorchLightning/pytorch-lightning/pull/1475)) - -- Decoupled the progress bar from trainer. It is a callback now and can be customized or even be replaced entirely ([#1450](https://github.com/PyTorchLightning/pytorch-lightning/pull/1450)). - -- Changed lr schedule step interval behavior to update every backwards pass instead of every forwards pass ([#1476](https://github.com/PyTorchLightning/pytorch-lightning/issues/1476)) - +- Decoupled the progress bar from trainer` it is a callback now and can be customized or even be replaced entirely ([#1450](https://github.com/PyTorchLightning/pytorch-lightning/pull/1450)). +- Changed lr schedule step interval behavior to update every backwards pass instead of every forwards pass ([#1477](https://github.com/PyTorchLightning/pytorch-lightning/pull/1477)) - Defines shared proc. rank, remove rank from instances (e.g. loggers) ([#1408](https://github.com/PyTorchLightning/pytorch-lightning/pull/1408)) - -- Updated semantic segmentation example with custom u-net and logging ([#1371](https://github.com/PyTorchLightning/pytorch-lightning/pull/1371)) - -- Diabled val and test shuffling ([#1600](https://github.com/PyTorchLightning/pytorch-lightning/pull/1600)) - +- Updated semantic segmentation example with custom U-Net and logging ([#1371](https://github.com/PyTorchLightning/pytorch-lightning/pull/1371)) +- Disabled val and test shuffling ([#1600](https://github.com/PyTorchLightning/pytorch-lightning/pull/1600)) ### Deprecated -- Deprecatd `training_tqdm_dict` in favor of `progress_bar_dict` ([#1450](https://github.com/PyTorchLightning/pytorch-lightning/pull/1450)). - +- Deprecated `training_tqdm_dict` in favor of `progress_bar_dict` ([#1450](https://github.com/PyTorchLightning/pytorch-lightning/pull/1450)). ### Removed -- Removed `test_dataloaders` parameter from `Trainer.fit()` ([#1393](https://github.com/PyTorchLightning/pytorch-lightning/issues/1393)) - +- Removed `test_dataloaders` parameter from `Trainer.fit()` ([#1434](https://github.com/PyTorchLightning/pytorch-lightning/pull/1434)) ### Fixed - Added the possibility to pass nested metrics dictionaries to loggers ([#1582](https://github.com/PyTorchLightning/pytorch-lightning/pull/1582)) - - Fixed memory leak from opt return ([#1528](https://github.com/PyTorchLightning/pytorch-lightning/pull/1528)) - - Fixed saving checkpoint before deleting old ones ([#1453](https://github.com/PyTorchLightning/pytorch-lightning/pull/1453)) - - Fixed loggers - flushing last logged metrics even before continue, e.g. `trainer.test()` results ([#1459](https://github.com/PyTorchLightning/pytorch-lightning/pull/1459)) - - Fixed optimizer configuration when `configure_optimizers` returns dict without `lr_scheduler` ([#1443](https://github.com/PyTorchLightning/pytorch-lightning/pull/1443)) - -- Fixed LightningModule - Mixing hparams and arguments in `LightningModule.__init__()` crashes load_from_checkpoint() ([#1505](https://github.com/PyTorchLightning/pytorch-lightning/pull/1505)) - +- Fixed `LightningModule` - mixing hparams and arguments in `LightningModule.__init__()` crashes load_from_checkpoint() ([#1505](https://github.com/PyTorchLightning/pytorch-lightning/pull/1505)) - Added a missing call to the `on_before_zero_grad` model hook ([#1493](https://github.com/PyTorchLightning/pytorch-lightning/pull/1493)). - -- Allow use of sweeps with WandbLogger ([#1512](https://github.com/PyTorchLightning/pytorch-lightning/pull/1512)) - +- Allow use of sweeps with `WandbLogger` ([#1512](https://github.com/PyTorchLightning/pytorch-lightning/pull/1512)) - Fixed a bug that caused the `callbacks` Trainer argument to reference a global variable ([#1534](https://github.com/PyTorchLightning/pytorch-lightning/pull/1534)). - -- Fixed a bug that set all boolean CLI arguments from Trainer.add_argparse_args always to True ([#1570](https://github.com/PyTorchLightning/pytorch-lightning/issues/1570)) - -- Fixed do not copy the batch when training on a single GPU ([#1576](https://github.com/PyTorchLightning/pytorch-lightning/issues/1576), [#1579](https://github.com/PyTorchLightning/pytorch-lightning/issues/1579)) - +- Fixed a bug that set all boolean CLI arguments from `Trainer.add_argparse_args` always to True ([#1571](https://github.com/PyTorchLightning/pytorch-lightning/pull/1571)) +- Fixed do not copy the batch when training on a single GPU ([#1576](https://github.com/PyTorchLightning/pytorch-lightning/pull/1576), [#1579](https://github.com/PyTorchLightning/pytorch-lightning/pull/1579)) - Fixed soft checkpoint removing on DDP ([#1408](https://github.com/PyTorchLightning/pytorch-lightning/pull/1408)) - -- Fixes automatic parser bug ([#1585](https://github.com/PyTorchLightning/pytorch-lightning/issues/1585)) - -- Fixed bool conversion from string ([#1606](https://github.com/PyTorchLightning/pytorch-lightning/issues/1606)) +- Fixed automatic parser bug ([#1585](https://github.com/PyTorchLightning/pytorch-lightning/pull/1585)) +- Fixed bool conversion from string ([#1606](https://github.com/PyTorchLightning/pytorch-lightning/pull/1606)) ## [0.7.3] - 2020-04-09 @@ -156,17 +136,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Removed - Removed test for no test dataloader in .fit ([#1495](https://github.com/PyTorchLightning/pytorch-lightning/pull/1495)) -- Removed duplicated module `pytorch_lightning.utilities.arg_parse` for loading CLI arguments ([#1167](https://github.com/PyTorchLightning/pytorch-lightning/issues/1167)) +- Removed duplicated module `pytorch_lightning.utilities.arg_parse` for loading CLI arguments ([#1167](https://github.com/PyTorchLightning/pytorch-lightning/pull/1167)) - Removed wandb logger's `finalize` method ([#1193](https://github.com/PyTorchLightning/pytorch-lightning/pull/1193)) -- Dropped `torchvision` dependency in tests and added own MNIST dataset class instead ([#986](https://github.com/PyTorchLightning/pytorch-lightning/issues/986)) +- Dropped `torchvision` dependency in tests and added own MNIST dataset class instead ([#986](https://github.com/PyTorchLightning/pytorch-lightning/pull/986)) ### Fixed - Fixed `model_checkpoint` when saving all models ([#1359](https://github.com/PyTorchLightning/pytorch-lightning/pull/1359)) - `Trainer.add_argparse_args` classmethod fixed. Now it adds a type for the arguments ([#1147](https://github.com/PyTorchLightning/pytorch-lightning/pull/1147)) -- Fixed bug related to type checking of `ReduceLROnPlateau` lr schedulers([#1114](https://github.com/PyTorchLightning/pytorch-lightning/issues/1114)) +- Fixed bug related to type checking of `ReduceLROnPlateau` lr schedulers([#1126](https://github.com/PyTorchLightning/pytorch-lightning/pull/1126)) - Fixed a bug to ensure lightning checkpoints to be backward compatible ([#1132](https://github.com/PyTorchLightning/pytorch-lightning/pull/1132)) -- Fixed a bug that created an extra dataloader with active `reload_dataloaders_every_epoch` ([#1181](https://github.com/PyTorchLightning/pytorch-lightning/issues/1181)) +- Fixed a bug that created an extra dataloader with active `reload_dataloaders_every_epoch` ([#1196](https://github.com/PyTorchLightning/pytorch-lightning/pull/1196)) - Fixed all warnings and errors in the docs build process ([#1191](https://github.com/PyTorchLightning/pytorch-lightning/pull/1191)) - Fixed an issue where `val_percent_check=0` would not disable validation ([#1251](https://github.com/PyTorchLightning/pytorch-lightning/pull/1251)) - Fixed average of incomplete `TensorRunningMean` ([#1309](https://github.com/PyTorchLightning/pytorch-lightning/pull/1309)) @@ -185,7 +165,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed `load_spawn_weights` only in proc rank 0 ([#1385](https://github.com/PyTorchLightning/pytorch-lightning/pull/1385)) - Fixes `use_amp` issue ([#1145](https://github.com/PyTorchLightning/pytorch-lightning/pull/1145)) - Fixes using deprecated `use_amp` attribute ([#1145](https://github.com/PyTorchLightning/pytorch-lightning/pull/1145)) -- Fixed Tensorboard logger error: lightning_logs directory not exists in multi-node DDP on nodes with rank != 0 ([#1375](https://github.com/PyTorchLightning/pytorch-lightning/issues/1375)) +- Fixed Tensorboard logger error: lightning_logs directory not exists in multi-node DDP on nodes with rank != 0 ([#1377](https://github.com/PyTorchLightning/pytorch-lightning/pull/1377)) - Fixed `Unimplemented backend XLA` error on TPU ([#1387](https://github.com/PyTorchLightning/pytorch-lightning/pull/1387)) ## [0.7.1] - 2020-03-07 diff --git a/pytorch_lightning/callbacks/gradient_accumulation_scheduler.py b/pytorch_lightning/callbacks/gradient_accumulation_scheduler.py index 0d2fa63b..bc1cd79e 100644 --- a/pytorch_lightning/callbacks/gradient_accumulation_scheduler.py +++ b/pytorch_lightning/callbacks/gradient_accumulation_scheduler.py @@ -45,11 +45,10 @@ class GradientAccumulationScheduler(Callback): raise TypeError("All epoches and accumulation factor must be integers") minimal_epoch = min(scheduling.keys()) - rank_zero_warn('Epochs indexing of `scheduling` starts from "1" until v0.6.x,' - ' but will start from "0" in v0.8.0.', DeprecationWarning) + # rank_zero_warn('Epochs indexing of `scheduling` starts from "1" until v0.6.x,' + # ' but will start from "0" in v0.8.0.', DeprecationWarning) if minimal_epoch < 1: - msg = f"Epochs indexing from 1, epoch {minimal_epoch} cannot be interpreted correct" - raise IndexError(msg) + raise IndexError(f"Epochs indexing from 1, epoch {minimal_epoch} cannot be interpreted correct") if minimal_epoch != 1: # if user didnt define first epoch accumulation factor scheduling.update({1: 1}) From 879d8799850eb068e3f61cb6c67744a6947cbbec Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 26 Apr 2020 17:27:45 -0400 Subject: [PATCH 09/42] fix hparams issue --- pytorch_lightning/trainer/training_io.py | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pytorch_lightning/trainer/training_io.py b/pytorch_lightning/trainer/training_io.py index 0e9d00c6..4bb3c406 100644 --- a/pytorch_lightning/trainer/training_io.py +++ b/pytorch_lightning/trainer/training_io.py @@ -325,6 +325,7 @@ class TrainerIOMixin(ABC): checkpoint['native_amp_scaling_state'] = self.scaler.state_dict() if hasattr(model, "hparams"): + self.__clean_namespace(model.hparams) is_namespace = isinstance(model.hparams, Namespace) checkpoint['hparams'] = vars(model.hparams) if is_namespace else model.hparams checkpoint['hparams_type'] = 'namespace' if is_namespace else 'dict' @@ -338,6 +339,31 @@ class TrainerIOMixin(ABC): return checkpoint + def __clean_namespace(self, hparams): + """ + Removes all functions from hparams so we can pickle + :param hparams: + :return: + """ + + if isinstance(hparams, Namespace): + del_attrs = [] + for k in hparams.__dict__: + if callable(getattr(hparams, k)): + del_attrs.append(k) + + for k in del_attrs: + delattr(hparams, k) + + elif isinstance(hparams, dict): + del_attrs = [] + for k, v in hparams.items(): + if callable(v): + del_attrs.append(k) + + for k in del_attrs: + del hparams[k] + # -------------------- # HPC IO # -------------------- From d40b4c8f80696cb8b9423ab8a097f743019e09b6 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 26 Apr 2020 17:30:50 -0400 Subject: [PATCH 10/42] fix hparams issue --- tests/trainer/test_trainer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 2d34be24..f783a2ef 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -79,12 +79,13 @@ def test_no_val_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() From e7a0d982771da54040a70062da4f6b428d1d86a1 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 26 Apr 2020 17:34:33 -0400 Subject: [PATCH 11/42] fix hparams issue --- tests/trainer/test_trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index f783a2ef..6876a693 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -27,7 +27,7 @@ from tests.base import ( def test_hparams_save_load(tmpdir): - model = DictHparamsModel({'in_features': 28 * 28, 'out_features': 10}) + model = DictHparamsModel({'in_features': 28 * 28, 'out_features': 10, 'failed_key': lambda x: x}) # logger file to get meta trainer_options = dict( From b672fff56493f86c5fa5d98d568c33aba3ade63d Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 23:35:08 +0200 Subject: [PATCH 12/42] revert --- .github/workflows/ci-testing.yml | 40 +++++++++++--------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index d5584198..5b91ebe4 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -1,6 +1,6 @@ name: CI testing -# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows +# 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 @@ -42,38 +42,35 @@ jobs: run: | brew install libomp # https://github.com/pytorch/pytorch/issues/20030 brew install openmpi # Horovod on macOS requires OpenMPI, Gloo not currently supported - - name: Setup Windows if: runner.os == 'windows' run: | python -c "lines = [line for line in open('requirements-extra.txt').readlines() if not line.startswith('horovod')] ; open('requirements-extra.txt', 'w').writelines(lines)" - # TODO: remove after https://github.com/pytorch/pytorch/issues/32186 is resolved - name: Setup Windows on Latest if: runner.os == 'windows' && matrix.requires == 'latest' run: | python -c "req = open('requirements.txt').read().replace('torch>=1.1', 'torch<1.5') ; open('requirements.txt', 'w').write(req)" - - name: Set min. dependencies if: matrix.requires == 'minimal' run: | python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" - - # Note: This uses an internal pip API and may not always work - # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow - - name: Get pip cache - id: pip-cache - run: | - python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - - name: Cache pip - - uses: actions/cache@v1 + uses: actions/cache@v1 with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} + path: ~/.cache/pip # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-pip- + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-${{ matrix.python-version }}- + - name: Cache datasets + uses: actions/cache@v1 + with: + path: tests/Datasets # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: mnist-dataset - name: Install dependencies run: | @@ -86,13 +83,6 @@ jobs: pip list shell: bash - - name: Cache datasets - uses: actions/cache@v1 - with: - path: tests/Datasets # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: mnist-dataset - - name: Tests # env: # TOXENV: py${{ matrix.python-version }} @@ -101,7 +91,6 @@ jobs: # flake8 . coverage run --source pytorch_lightning -m py.test pytorch_lightning tests -v --doctest-modules --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml coverage report - - name: Upload pytest test results uses: actions/upload-artifact@master with: @@ -116,7 +105,6 @@ jobs: python setup.py check --metadata --strict python setup.py sdist twine check dist/* - #- name: Try install package # if: ! startsWith(matrix.os, 'windows') # run: | @@ -127,4 +115,4 @@ jobs: - name: Statistics if: success() run: | - coverage report + coverage report \ No newline at end of file From 0c285cd76f5f547ee1228e15e653c0b7d2dc488d Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 23:47:59 +0200 Subject: [PATCH 13/42] refactor --- .github/workflows/ci-testing.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 5b91ebe4..baa6f50d 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -42,20 +42,24 @@ jobs: run: | brew install libomp # https://github.com/pytorch/pytorch/issues/20030 brew install openmpi # Horovod on macOS requires OpenMPI, Gloo not currently supported + - name: Setup Windows if: runner.os == 'windows' run: | python -c "lines = [line for line in open('requirements-extra.txt').readlines() if not line.startswith('horovod')] ; open('requirements-extra.txt', 'w').writelines(lines)" + # TODO: remove after https://github.com/pytorch/pytorch/issues/32186 is resolved - name: Setup Windows on Latest if: runner.os == 'windows' && matrix.requires == 'latest' run: | python -c "req = open('requirements.txt').read().replace('torch>=1.1', 'torch<1.5') ; open('requirements.txt', 'w').write(req)" + - name: Set min. dependencies if: matrix.requires == 'minimal' run: | python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" + - name: Cache pip uses: actions/cache@v1 with: @@ -65,12 +69,6 @@ jobs: restore-keys: | ${{ runner.os }}-pip-${{ matrix.python-version }}- ${{ runner.os }}-${{ matrix.python-version }}- - - name: Cache datasets - uses: actions/cache@v1 - with: - path: tests/Datasets # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: mnist-dataset - name: Install dependencies run: | @@ -83,6 +81,13 @@ jobs: pip list shell: bash + - name: Cache datasets + uses: actions/cache@v1 + with: + path: tests/Datasets # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: mnist-dataset + - name: Tests # env: # TOXENV: py${{ matrix.python-version }} @@ -91,6 +96,7 @@ jobs: # flake8 . coverage run --source pytorch_lightning -m py.test pytorch_lightning tests -v --doctest-modules --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml coverage report + - name: Upload pytest test results uses: actions/upload-artifact@master with: From acfb054103168c5c8d1275a059cc5c04a0d35a34 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 26 Apr 2020 17:48:27 -0400 Subject: [PATCH 14/42] Update __init__.py --- pytorch_lightning/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' From f76b1125e22055896aff0e61b00e6b7eadcedf1b Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Sun, 26 Apr 2020 23:52:13 +0200 Subject: [PATCH 15/42] cache --- .github/workflows/ci-testing.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index baa6f50d..73be7afd 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -60,15 +60,20 @@ jobs: python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)" python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)" + # Note: This uses an internal pip API and may not always work + # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow + - name: Get pip cache + id: pip-cache + run: | + python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" + - name: Cache pip - uses: actions/cache@v1 + - uses: actions/cache@v1 with: - path: ~/.cache/pip # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - ${{ runner.os }}-${{ matrix.python-version }}- + ${{ runner.os }}-${{ matrix.python-version }}-pip- - name: Install dependencies run: | From a7ccd553724471b2958489a1ab03ca16aa9a14be Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Mon, 27 Apr 2020 00:00:22 +0200 Subject: [PATCH 16/42] cache --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 73be7afd..f6200070 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -73,7 +73,7 @@ jobs: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-pip- + ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} - name: Install dependencies run: | From e8de5282f051ecb8844e9d7701bb4ca30023a005 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Mon, 27 Apr 2020 00:07:35 +0200 Subject: [PATCH 17/42] cache --- .github/workflows/ci-testing.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index f6200070..7a43fdb3 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -72,8 +72,6 @@ jobs: with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} - name: Install dependencies run: | From b19d61c251d2479849fb1937178753fc3d2fe0e6 Mon Sep 17 00:00:00 2001 From: "J. Borovec" Date: Mon, 27 Apr 2020 00:09:10 +0200 Subject: [PATCH 18/42] cache --- .github/workflows/ci-testing.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 7a43fdb3..36e49e0e 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -68,10 +68,12 @@ jobs: python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" - name: Cache pip - - uses: actions/cache@v1 + uses: actions/cache@v1 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-extra.txt') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.python-version }}-pip- - name: Install dependencies run: | From e309b55b38b22a60cd4f5380635a34e307459777 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 09:44:26 +0200 Subject: [PATCH 19/42] Update tensorboard.py --- pytorch_lightning/loggers/tensorboard.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/loggers/tensorboard.py b/pytorch_lightning/loggers/tensorboard.py index 613262dd..36169e0a 100644 --- a/pytorch_lightning/loggers/tensorboard.py +++ b/pytorch_lightning/loggers/tensorboard.py @@ -101,7 +101,8 @@ class TensorBoardLogger(LightningLoggerBase): return self._experiment @rank_zero_only - def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None: + def log_hyperparams(self, params: Union[Dict[str, Any], Namespace], + metrics: Optional[Dict[str, Any]] = None) -> None: params = self._convert_params(params) params = self._flatten_dict(params) sanitized_params = self._sanitize_params(params) @@ -114,7 +115,9 @@ class TensorBoardLogger(LightningLoggerBase): ) else: from torch.utils.tensorboard.summary import hparams - exp, ssi, sei = hparams(sanitized_params, {}) + if metrics is None: + metrics = {} + exp, ssi, sei = hparams(sanitized_params, metrics) writer = self.experiment._get_file_writer() writer.add_summary(exp) writer.add_summary(ssi) From 0ae7f479d302aca59994d2b6bc67e23ec8f4afbb Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 09:47:00 +0200 Subject: [PATCH 20/42] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b8e2f29..212c7833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Added ### Changed + +- Allow logging of metrics togther with hparams ([#1630](https://github.com/PyTorchLightning/pytorch-lightning/pull/1630)) ### Deprecated From cdbf2f4a37b21a572205bb2c0bcab8ad41117863 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 09:47:35 +0200 Subject: [PATCH 21/42] Update tensorboard.py --- pytorch_lightning/loggers/tensorboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/loggers/tensorboard.py b/pytorch_lightning/loggers/tensorboard.py index 36169e0a..fc33c9e9 100644 --- a/pytorch_lightning/loggers/tensorboard.py +++ b/pytorch_lightning/loggers/tensorboard.py @@ -101,7 +101,7 @@ class TensorBoardLogger(LightningLoggerBase): return self._experiment @rank_zero_only - def log_hyperparams(self, params: Union[Dict[str, Any], Namespace], + def log_hyperparams(self, params: Union[Dict[str, Any], Namespace], metrics: Optional[Dict[str, Any]] = None) -> None: params = self._convert_params(params) params = self._flatten_dict(params) From 312e394654f7fd4b259e84bec6e5475e4d837f80 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 09:50:01 +0200 Subject: [PATCH 22/42] Update test_tensorboard.py --- tests/loggers/test_tensorboard.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/loggers/test_tensorboard.py b/tests/loggers/test_tensorboard.py index 937a233c..4e5974b2 100644 --- a/tests/loggers/test_tensorboard.py +++ b/tests/loggers/test_tensorboard.py @@ -77,3 +77,19 @@ def test_tensorboard_log_hyperparams(tmpdir): "layer": torch.nn.BatchNorm1d } logger.log_hyperparams(hparams) + +def test_tensorboard_log_hparams_and_metrics + logger = TensorBoardLogger(tmpdir) + hparams = { + "float": 0.3, + "int": 1, + "string": "abc", + "bool": True, + "dict": {'a': {'b': 'c'}}, + "list": [1, 2, 3], + "namespace": Namespace(foo=Namespace(bar='buzz')), + "layer": torch.nn.BatchNorm1d + } + metrics = {'abc': torch.tensor([0.54])} + logger.log_hyperparams(hparams, metrics) + From 335819e1b7cd3e206a2cf46f4621e1bd771b4c2b Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 09:52:31 +0200 Subject: [PATCH 23/42] Update test_tensorboard.py --- tests/loggers/test_tensorboard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/loggers/test_tensorboard.py b/tests/loggers/test_tensorboard.py index 4e5974b2..27ee234b 100644 --- a/tests/loggers/test_tensorboard.py +++ b/tests/loggers/test_tensorboard.py @@ -77,7 +77,8 @@ def test_tensorboard_log_hyperparams(tmpdir): "layer": torch.nn.BatchNorm1d } logger.log_hyperparams(hparams) - + + def test_tensorboard_log_hparams_and_metrics logger = TensorBoardLogger(tmpdir) hparams = { From ccd49cfbc5dd4f5290c3e04c3036a8d5ce47af7f Mon Sep 17 00:00:00 2001 From: Justus Schock Date: Mon, 27 Apr 2020 09:53:59 +0200 Subject: [PATCH 24/42] tests pep8 --- tests/loggers/test_tensorboard.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/loggers/test_tensorboard.py b/tests/loggers/test_tensorboard.py index 27ee234b..a17cedc4 100644 --- a/tests/loggers/test_tensorboard.py +++ b/tests/loggers/test_tensorboard.py @@ -79,7 +79,7 @@ def test_tensorboard_log_hyperparams(tmpdir): logger.log_hyperparams(hparams) -def test_tensorboard_log_hparams_and_metrics +def test_tensorboard_log_hparams_and_metrics(tmpdir): logger = TensorBoardLogger(tmpdir) hparams = { "float": 0.3, @@ -93,4 +93,3 @@ def test_tensorboard_log_hparams_and_metrics } metrics = {'abc': torch.tensor([0.54])} logger.log_hyperparams(hparams, metrics) - From 735520b03ec7a28acc73a015cffccaf9fffede44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Jab=C5=82o=C5=84ski?= Date: Mon, 27 Apr 2020 11:02:33 +0200 Subject: [PATCH 25/42] Fix ModelCheckpoint not being fixable. --- pytorch_lightning/callbacks/model_checkpoint.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index 1d5d6d14..44d240b5 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -116,10 +116,10 @@ class ModelCheckpoint(Callback): torch_inf = torch.tensor(np.Inf) mode_dict = { - 'min': (torch.lt, torch_inf, 'min'), - 'max': (torch.gt, -torch_inf, 'max'), - 'auto': (torch.gt, -torch_inf, 'max') if 'acc' in self.monitor or self.monitor.startswith('fmeasure') - else (torch.lt, torch_inf, 'min'), + 'min': (torch_inf, 'min'), + 'max': (-torch_inf, 'max'), + 'auto': (-torch_inf, 'max') if 'acc' in self.monitor or self.monitor.startswith('fmeasure') + else (torch_inf, 'min'), } if mode not in mode_dict: @@ -127,7 +127,7 @@ class ModelCheckpoint(Callback): f'fallback to auto mode.', RuntimeWarning) mode = 'auto' - self.monitor_op, self.kth_value, self.mode = mode_dict[mode] + self.kth_value, self.mode = mode_dict[mode] def _del_model(self, filepath): if os.path.isfile(filepath): @@ -151,7 +151,12 @@ class ModelCheckpoint(Callback): if not isinstance(current, torch.Tensor): current = torch.tensor(current) - return self.monitor_op(current, self.best_k_models[self.kth_best_model]) + monitor_op = { + "min": torch.lt, + "max": torch.gt, + }[self.mode] + + return monitor_op(current, self.best_k_models[self.kth_best_model]) def format_checkpoint_name(self, epoch, metrics, ver=None): """Generate a filename according to the defined template. From f91b131ba2f60d5c97a8a5e5f2bbf76ea5b35077 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 11:41:03 +0200 Subject: [PATCH 26/42] Remove warning --- pytorch_lightning/trainer/training_loop.py | 3 --- 1 file changed, 3 deletions(-) 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() From f38b29ce6d1ff9245d318354758c495f1a022069 Mon Sep 17 00:00:00 2001 From: Justus Schock <12886177+justusschock@users.noreply.github.com> Date: Mon, 27 Apr 2020 11:44:04 +0200 Subject: [PATCH 27/42] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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 From 6e86b59d21be4c895c3620a5e63701f2cefc451a Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 06:51:42 -0400 Subject: [PATCH 28/42] ddp pickle --- pytorch_lightning/trainer/trainer.py | 4 ++++ pytorch_lightning/trainer/training_io.py | 29 ++---------------------- pytorch_lightning/utilities/parsing.py | 29 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index eeafb73f..d7fcd1d6 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -711,6 +711,10 @@ class Trainer( model.logger = self.logger self.copy_trainer_model_properties(model) + # clean hparams + if hasattr(model, 'hparams'): + parsing.clean_namespace(model.hparams) + # set up the passed in dataloaders (if needed) self.__attach_dataloaders(model, train_dataloader, val_dataloaders) diff --git a/pytorch_lightning/trainer/training_io.py b/pytorch_lightning/trainer/training_io.py index 4bb3c406..82bc0829 100644 --- a/pytorch_lightning/trainer/training_io.py +++ b/pytorch_lightning/trainer/training_io.py @@ -101,7 +101,7 @@ from pytorch_lightning.overrides.data_parallel import ( LightningDistributedDataParallel, LightningDataParallel, ) -from pytorch_lightning.utilities import rank_zero_warn +from pytorch_lightning.utilities import rank_zero_warn, parsing try: import torch_xla @@ -325,7 +325,7 @@ class TrainerIOMixin(ABC): checkpoint['native_amp_scaling_state'] = self.scaler.state_dict() if hasattr(model, "hparams"): - self.__clean_namespace(model.hparams) + parsing.clean_namespace(model.hparams) is_namespace = isinstance(model.hparams, Namespace) checkpoint['hparams'] = vars(model.hparams) if is_namespace else model.hparams checkpoint['hparams_type'] = 'namespace' if is_namespace else 'dict' @@ -339,31 +339,6 @@ class TrainerIOMixin(ABC): return checkpoint - def __clean_namespace(self, hparams): - """ - Removes all functions from hparams so we can pickle - :param hparams: - :return: - """ - - if isinstance(hparams, Namespace): - del_attrs = [] - for k in hparams.__dict__: - if callable(getattr(hparams, k)): - del_attrs.append(k) - - for k in del_attrs: - delattr(hparams, k) - - elif isinstance(hparams, dict): - del_attrs = [] - for k, v in hparams.items(): - if callable(v): - del_attrs.append(k) - - for k in del_attrs: - del hparams[k] - # -------------------- # HPC IO # -------------------- diff --git a/pytorch_lightning/utilities/parsing.py b/pytorch_lightning/utilities/parsing.py index 26fc410d..2549e485 100644 --- a/pytorch_lightning/utilities/parsing.py +++ b/pytorch_lightning/utilities/parsing.py @@ -1,3 +1,6 @@ +from argparse import Namespace + + def strtobool(val): """Convert a string representation of truth to true (1) or false (0). Copied from the python implementation distutils.utils.strtobool @@ -18,3 +21,29 @@ def strtobool(val): return 0 else: raise ValueError(f'invalid truth value {val}') + + +def clean_namespace(hparams): + """ + Removes all functions from hparams so we can pickle + :param hparams: + :return: + """ + + if isinstance(hparams, Namespace): + del_attrs = [] + for k in hparams.__dict__: + if callable(getattr(hparams, k)): + del_attrs.append(k) + + for k in del_attrs: + delattr(hparams, k) + + elif isinstance(hparams, dict): + del_attrs = [] + for k, v in hparams.items(): + if callable(v): + del_attrs.append(k) + + for k in del_attrs: + del hparams[k] From 4aac5568a62039f6d51088b50f7f433a68fb9ec9 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:05:29 -0400 Subject: [PATCH 29/42] ddp pickle --- pytorch_lightning/trainer/trainer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index d7fcd1d6..d3f20881 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -620,11 +620,11 @@ class Trainer( else: return int(x) - def arg_default(x): - if ',' in x: - return str(x) - else: - return int(x) + # def arg_default(x): + # if ',' in x: + # return str(x) + # else: + # return int(x) parser.add_argument( f'--{arg}', From d5dff384eb5a2b885922065ec33c39ff255cf485 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:07:03 -0400 Subject: [PATCH 30/42] ddp pickle --- pytorch_lightning/trainer/trainer.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index d3f20881..59cdf41b 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -620,11 +620,13 @@ class Trainer( else: return int(x) - # def arg_default(x): - # if ',' in x: - # return str(x) - # else: - # return int(x) + def arg_default_fx(x): + if ',' in x: + return str(x) + else: + return int(x) + + arg_default = arg_default_fx parser.add_argument( f'--{arg}', From d2989f76e6e1474d654f830017b69662b5060aca Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:08:34 -0400 Subject: [PATCH 31/42] ddp pickle --- pytorch_lightning/trainer/trainer.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index 59cdf41b..deed0098 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -614,19 +614,8 @@ class Trainer( return bool(parsing.strtobool(x)) if arg == 'gpus': - def allowed_type(x): - if ',' in x: - return str(x) - else: - return int(x) - - def arg_default_fx(x): - if ',' in x: - return str(x) - else: - return int(x) - - arg_default = arg_default_fx + allowed_type = Trainer.allowed_type + arg_default = Trainer.arg_default parser.add_argument( f'--{arg}', @@ -639,6 +628,18 @@ class Trainer( return parser + def allowed_type(x): + if ',' in x: + return str(x) + else: + return int(x) + + def arg_default(x): + if ',' in x: + return str(x) + else: + return int(x) + @classmethod def from_argparse_args(cls, args, **kwargs): From 2181ad1bc737880c3949d43735101033d126baae Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:12:04 -0400 Subject: [PATCH 32/42] ddp pickle --- pytorch_lightning/trainer/data_loading.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytorch_lightning/trainer/data_loading.py b/pytorch_lightning/trainer/data_loading.py index 7d0b8180..92fb73e2 100644 --- a/pytorch_lightning/trainer/data_loading.py +++ b/pytorch_lightning/trainer/data_loading.py @@ -134,6 +134,7 @@ class TrainerDataLoadingMixin(ABC): 'ddp': self.num_nodes * self.num_processes, 'ddp2': self.num_nodes, } + import pdb; pdb.set_trace() sampler = DistributedSampler( dataloader.dataset, num_replicas=world_size.get(self.distributed_backend, 0), From cebc74f7bccd1f20aca969707487dca34ec5bdb5 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:19:12 -0400 Subject: [PATCH 33/42] ddp pickle --- pytorch_lightning/trainer/data_loading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/trainer/data_loading.py b/pytorch_lightning/trainer/data_loading.py index 92fb73e2..b3e15024 100644 --- a/pytorch_lightning/trainer/data_loading.py +++ b/pytorch_lightning/trainer/data_loading.py @@ -133,8 +133,8 @@ class TrainerDataLoadingMixin(ABC): world_size = { 'ddp': self.num_nodes * self.num_processes, 'ddp2': self.num_nodes, + 'ddp_cpu': self.num_processes * self.num_nodes } - import pdb; pdb.set_trace() sampler = DistributedSampler( dataloader.dataset, num_replicas=world_size.get(self.distributed_backend, 0), From b993a3ed399de2fdf2d5fd9f5646160d53fa2588 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:21:58 -0400 Subject: [PATCH 34/42] ddp pickle --- tests/trainer/test_trainer_cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/trainer/test_trainer_cli.py b/tests/trainer/test_trainer_cli.py index bfc67111..93cbb8e2 100644 --- a/tests/trainer/test_trainer_cli.py +++ b/tests/trainer/test_trainer_cli.py @@ -47,6 +47,11 @@ def test_add_argparse_args_redefined(cli_args): assert depr_name not in args trainer = Trainer.from_argparse_args(args=args) + + # make sure trainer can be pickled + import pickle + pickle.dumps(trainer) + assert isinstance(trainer, Trainer) From 5c0118fe9d049f29c2259a428975c25dfc2bd83c Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:41:30 -0400 Subject: [PATCH 35/42] ddp pickle --- tests/callbacks/test_callbacks.py | 9 +++++++++ tests/loggers/test_all.py | 5 +++++ tests/trainer/test_trainer.py | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/tests/callbacks/test_callbacks.py b/tests/callbacks/test_callbacks.py index 4731d435..c6c36ca5 100644 --- a/tests/callbacks/test_callbacks.py +++ b/tests/callbacks/test_callbacks.py @@ -240,6 +240,15 @@ def test_early_stopping_no_val_step(tmpdir): assert trainer.current_epoch < trainer.max_epochs +def test_pickling(tmpdir): + import pickle + early_stopping = EarlyStopping() + ckpt = ModelCheckpoint(tmpdir) + + pickle.dumps(ckpt) + pickle.dumps(early_stopping) + + def test_model_checkpoint_with_non_string_input(tmpdir): """ Test that None in checkpoint callback is valid and that chkp_path is set correctly """ diff --git a/tests/loggers/test_all.py b/tests/loggers/test_all.py index d9bb804b..85751204 100644 --- a/tests/loggers/test_all.py +++ b/tests/loggers/test_all.py @@ -77,6 +77,8 @@ def test_loggers_fit_test(tmpdir, monkeypatch, logger_class): # WandbLogger, # TODO: add this one ]) def test_loggers_pickle(tmpdir, monkeypatch, logger_class): + import pickle + """Verify that pickling trainer with logger works.""" tutils.reset_seed() @@ -88,6 +90,9 @@ def test_loggers_pickle(tmpdir, monkeypatch, logger_class): logger_args = _get_logger_args(logger_class, tmpdir) logger = logger_class(**logger_args) + # test pickling loggers + pickle.dumps(logger) + trainer = Trainer( max_epochs=1, logger=logger diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 6876a693..9d8217f9 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -24,6 +24,14 @@ from tests.base import ( LightTestDataloader, LightValidationMixin, ) +from tests.base import TestModelBase + + +def test_model_pickle(tmpdir): + import pickle + + model = TestModelBase() + pickle.dumps(model) def test_hparams_save_load(tmpdir): From a3cebb44698cdcbb2c5cb1eef0839d65dc81a3e4 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:44:45 -0400 Subject: [PATCH 36/42] ddp pickle --- tests/trainer/test_trainer_cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/trainer/test_trainer_cli.py b/tests/trainer/test_trainer_cli.py index 93cbb8e2..b2d1da95 100644 --- a/tests/trainer/test_trainer_cli.py +++ b/tests/trainer/test_trainer_cli.py @@ -1,6 +1,7 @@ import inspect from argparse import ArgumentParser, Namespace from unittest import mock +import pickle import pytest @@ -42,14 +43,14 @@ def test_add_argparse_args_redefined(cli_args): args = parser.parse_args(cli_args) + # make sure we can pickle args + pickle.dumps(args) + # Check few deprecated args are not in namespace: for depr_name in ('gradient_clip', 'nb_gpu_nodes', 'max_nb_epochs'): assert depr_name not in args trainer = Trainer.from_argparse_args(args=args) - - # make sure trainer can be pickled - import pickle pickle.dumps(trainer) assert isinstance(trainer, Trainer) From 710dbf5a12808d639fd5a2a01d9e821f763fd8a0 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 07:57:09 -0400 Subject: [PATCH 37/42] ddp pickle --- tests/trainer/test_trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 9d8217f9..116cafcc 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -30,7 +30,7 @@ from tests.base import TestModelBase def test_model_pickle(tmpdir): import pickle - model = TestModelBase() + model = TestModelBase(tutils.get_default_hparams()) pickle.dumps(model) From a24c88ab08392d3c7cb4863df8f6dfcea7958d07 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 08:19:19 -0400 Subject: [PATCH 38/42] ddp pickle --- pytorch_lightning/callbacks/early_stopping.py | 13 +++++++++++-- pytorch_lightning/trainer/distrib_data_parallel.py | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/callbacks/early_stopping.py b/pytorch_lightning/callbacks/early_stopping.py index 4c30b677..d383a2fb 100644 --- a/pytorch_lightning/callbacks/early_stopping.py +++ b/pytorch_lightning/callbacks/early_stopping.py @@ -57,6 +57,7 @@ class EarlyStopping(Callback): self.min_delta = min_delta self.wait = 0 self.stopped_epoch = 0 + self.mode = mode mode_dict = { 'min': torch.lt, @@ -67,9 +68,8 @@ class EarlyStopping(Callback): if mode not in mode_dict: if self.verbose > 0: log.info(f'EarlyStopping mode {mode} is unknown, fallback to auto mode.') - mode = 'auto' + self.mode = 'auto' - self.monitor_op = mode_dict[mode] self.min_delta *= 1 if self.monitor_op == torch.gt else -1 def _validate_condition_metric(self, logs): @@ -94,6 +94,15 @@ class EarlyStopping(Callback): return True + @property + def monitor_op(self): + mode_dict = { + 'min': torch.lt, + 'max': torch.gt, + 'auto': torch.gt if 'acc' in self.monitor else torch.lt + } + return mode_dict[self.mode] + def on_train_start(self, trainer, pl_module): # Allow instances to be re-used self.wait = 0 diff --git a/pytorch_lightning/trainer/distrib_data_parallel.py b/pytorch_lightning/trainer/distrib_data_parallel.py index 659aa7a0..f26901c0 100644 --- a/pytorch_lightning/trainer/distrib_data_parallel.py +++ b/pytorch_lightning/trainer/distrib_data_parallel.py @@ -378,6 +378,7 @@ class TrainerDDPMixin(ABC): :param model: :return: """ + import pdb; pdb.set_trace() if self.proc_rank == 0: path = os.path.join(self.default_root_dir, '__temp_weight_ddp_end.ckpt') self.save_checkpoint(path) From 63addd091cfbcc76456c150431fe0ea168bf024c Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 08:28:39 -0400 Subject: [PATCH 39/42] ddp fix --- pytorch_lightning/trainer/distrib_data_parallel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pytorch_lightning/trainer/distrib_data_parallel.py b/pytorch_lightning/trainer/distrib_data_parallel.py index f26901c0..659aa7a0 100644 --- a/pytorch_lightning/trainer/distrib_data_parallel.py +++ b/pytorch_lightning/trainer/distrib_data_parallel.py @@ -378,7 +378,6 @@ class TrainerDDPMixin(ABC): :param model: :return: """ - import pdb; pdb.set_trace() if self.proc_rank == 0: path = os.path.join(self.default_root_dir, '__temp_weight_ddp_end.ckpt') self.save_checkpoint(path) From e7ea564df2bf11e8efd7a7853bed067781e7d487 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 08:47:19 -0400 Subject: [PATCH 40/42] pep8 --- tests/loggers/test_all.py | 2 -- tests/trainer/test_trainer.py | 1 - 2 files changed, 3 deletions(-) diff --git a/tests/loggers/test_all.py b/tests/loggers/test_all.py index 85751204..383ca263 100644 --- a/tests/loggers/test_all.py +++ b/tests/loggers/test_all.py @@ -77,8 +77,6 @@ def test_loggers_fit_test(tmpdir, monkeypatch, logger_class): # WandbLogger, # TODO: add this one ]) def test_loggers_pickle(tmpdir, monkeypatch, logger_class): - import pickle - """Verify that pickling trainer with logger works.""" tutils.reset_seed() diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 116cafcc..18cc2586 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -24,7 +24,6 @@ from tests.base import ( LightTestDataloader, LightValidationMixin, ) -from tests.base import TestModelBase def test_model_pickle(tmpdir): From 694f1d789dfa56b365b68dd4f3c6f5f7a4c8970a Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 09:04:55 -0400 Subject: [PATCH 41/42] Update __init__.py --- pytorch_lightning/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/__init__.py b/pytorch_lightning/__init__.py index 2a656ce2..705bdfc6 100644 --- a/pytorch_lightning/__init__.py +++ b/pytorch_lightning/__init__.py @@ -1,6 +1,6 @@ """Root package info.""" -__version__ = '0.7.5rc1' +__version__ = '0.7.5' __author__ = 'William Falcon et al.' __author_email__ = 'waf2107@columbia.edu' __license__ = 'Apache-2.0' From 835ea9c2e382005c0078fdd054f63223f417956b Mon Sep 17 00:00:00 2001 From: William Falcon Date: Mon, 27 Apr 2020 10:31:38 -0400 Subject: [PATCH 42/42] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65035e45..bb7d846a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![codecov](https://codecov.io/gh/PyTorchLightning/pytorch-lightning/branch/master/graph/badge.svg)](https://codecov.io/gh/PyTorchLightning/pytorch-lightning) [![CodeFactor](https://www.codefactor.io/repository/github/pytorchlightning/pytorch-lightning/badge)](https://www.codefactor.io/repository/github/pytorchlightning/pytorch-lightning) -[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=0.7.4)](https://pytorch-lightning.readthedocs.io/en/latest/) +[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=0.7.5)](https://pytorch-lightning.readthedocs.io/en/stable/) [![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/pytorch-lightning/shared_invite/enQtODU5ODIyNTUzODQwLTFkMDg5Mzc1MDBmNjEzMDgxOTVmYTdhYjA1MDdmODUyOTg2OGQ1ZWZkYTQzODhhNzdhZDA3YmNhMDhlMDY4YzQ) [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/PytorchLightning/pytorch-lightning/blob/master/LICENSE) [![Next Release](https://img.shields.io/badge/Next%20Release-May%2006-.svg)](https://shields.io/) @@ -44,7 +44,7 @@ pip install pytorch-lightning ## Docs - [master](https://pytorch-lightning.readthedocs.io/en/latest) -- [0.7.4](https://pytorch-lightning.readthedocs.io/en/0.7.4/) +- [0.7.5](https://pytorch-lightning.readthedocs.io/en/0.7.5/) - [0.7.3](https://pytorch-lightning.readthedocs.io/en/0.7.3/) - [0.7.1](https://pytorch-lightning.readthedocs.io/en/0.7.1/) - [0.6.0](https://pytorch-lightning.readthedocs.io/en/0.6.0/)