Commit Graph

2141 Commits

Author SHA1 Message Date
Adrian Wälchli 3c549e8ae3
Call on_before_zero_grad model hook (#1493)
* call on_before_zero_grad

* update changelog

* add note about overriding both hooks

* added test

* move test_hooks.py to models folder
2020-04-16 12:01:41 -04:00
Boris Dayma 06e6eadfaf
feat(semseg): allow model customization (#1371)
* feat(semantic_segmentation): allow customization of unet

* feat(semseg): allow model customization

* style(semseg): format to PEP8

* fix(semseg): rename logger

* docs(changelog): updated semantic segmentation example

* suggestions

* suggestions

* flake8

Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-16 12:00:24 -04:00
Nic Eggert e3001a0929
Add ddp_cpu backend for testing ddp without GPUs (#1158)
* Add tests for distributed backend config

* Refactor set_distributed_mode

* Use gloo backend on cpu

* Use 127.0.0.1 instead of 127.0.0.2

Not totally clear on why this is necessary, but it seemt to work

* Update LightningDDP so that it works with CPU

* Add ddp_cpu backend and num_processes Trainer arg

* PEP8

* Fix test skipping. Inequalities are hard :/

* Skip ddp_cpu test on Windows

* Make a few more cases fall back to ddp_cpu

* New function name

* Flake8

* Don't test distributed on MacOS with torch < 1.3

Support for distributed in MacOS was added in Torch 1.3.0

* Add ddp_cpu and num_processes to docs

* Parametrize trainer config tests

* Tweak warning

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* Remove redundant test

* Replace pass branches with comments

* Add missing warnings import

* save_path -> root_dir

* Use new rank_zero_warn

* Whitespace

* Apply suggestions from code review

* formatting

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-15 23:17:31 -04:00
William Falcon 3431c62d41
Remove error when test dataloader used in test (#1495)
* remove error when test dataloader used in test

* remove error when test dataloader used in test

* remove error when test dataloader used in test

* remove error when test dataloader used in test

* remove error when test dataloader used in test

* remove error when test dataloader used in test

* fix lost model reference

* remove error when test dataloader used in test

* fix lost model reference

* moved optimizer types

* moved optimizer types

* moved optimizer types

* moved optimizer types

* moved optimizer types

* moved optimizer types

* moved optimizer types

* moved optimizer types

* added tests for warning

* fix lost model reference

* fix lost model reference

* added tests for warning

* added tests for warning

* refactoring

* refactoring

* fix imports

* refactoring

* fix imports

* refactoring

* fix tests

* fix mnist

* flake8

* review

Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-15 22:16:40 -04:00
Jirka Borovec 8322f1b039
neptune online (#1499) 2020-04-15 11:14:29 -04:00
Jirka Borovec b3fe17ddeb
fix flushing loggers (#1459)
* flushing loggers

* flushing loggers

* flushing loggers

* flushing loggers

* changelog

* typo

* fix trains

* optimize imports

* add logger test all

* add logger test pickle

* flake8

* fix benchmark

* hanging loggers

* try

* del

* all

* cleaning
2020-04-14 20:32:33 -04:00
William Falcon c96c6a6b33
attempting to remove some speed issues (#1482)
* removed some .items

* added speed tests

* added speed tests

* Update benchmarks/test_rnn_parity.py

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* Update benchmarks/test_trainer_parity.py

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* fix lost model reference

* added speed tests

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-04-14 20:23:36 -04:00
Justus Schock f293c9b5f4
Merge pull request #1473 from aiyolo/patch-3
docs typo
2020-04-14 10:04:28 +02:00
Ethan Harris 8544b334e4
Replace automatic nan check with optional flag (#1475)
* Replace automatic nan check with optional flag

* Update CHANGELOG.md
2020-04-13 14:06:25 -04:00
Caldera 1b45ddcd17
typing error
it should be val_batch here.
2020-04-14 00:16:54 +08:00
Nicki Skafte 3f1e4b953f
fix lr scheduler docs (#1446)
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
2020-04-10 16:14:51 -04:00
Nicki Skafte 3f09b32df3
Learning Rate finder (#1347)
* initial structure

* rebase

* incorporate suggestions

* update CHANGELOG.md

* initial docs

* fixes based on reviews

* added trainer arg

* update docs

* added saving/restore of model state

* initial tests

* fix styling

* added more tests

* fix docs, backward compatility and progressbar

* fix styling

* docs update

* updates based on review

* changed saving to standard functions

* consistent naming

* fix formatting

* improve docs, added support for nested fields, improve codecov

* update CHANGELOG.md

* Update lr_finder.rst

* Update pytorch_lightning/trainer/trainer.py

* Update trainer.py

* Update CHANGELOG.md

* Update path

* restoring

* test

* attribs

* docs

* doc typo

Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-10 14:34:23 -04:00
Jirka Borovec d05ac813dc
fix deprecated default_save_path (#1449) 2020-04-10 14:32:56 -04:00
Jirka Borovec dcda5194df
continues develop (#1419)
* continues develop

* changelog

* typo
2020-04-10 13:10:46 -04:00
William Falcon b78c3d4da8
Fix weights path (#1445)
* renamed default path to actual root_dir

* added default weights path

* added default weights path

* added default weights path
2020-04-10 12:02:59 -04:00
Allard Hendriksen 7ac1580a31
Add automatic GPU choice to trainer (#1426)
* Add automatic GPU choice to trainer

This commit adds the `gpu_choice` parameter to Trainer. By default,
this parameter is set to 'manual' which causes no observable
difference in behavior.

When `gpu_choice` is set to "auto" and `gpus` is an int, then the
trainer will automatically allocate the first available GPU.
This is especially useful when GPUs are configured to be in "exclusive
mode", which means that only one process at a time can use them.

* Rename gpu_choice -> auto_select_gpus
2020-04-10 11:45:29 -04:00
Rohit Gupta e79ae18cae
Add test_dataloaders to test method (#1434)
* Add test_dataloaders to test method

* Remove test_dataloaders from .fit()

* Fix code comment

* Fix tests

* Add test_dataloaders to test method (#1393)

* Fix failing tests

* Update docs (#1393)
2020-04-10 11:44:03 -04:00
Alexey Karnachev 4c34d16a34
Fixed configure optimizer from dict without "scheduler" key (#1443)
* `configure_optimizer` from dict with only "optimizer" key. bug fixed

* autopep8

* pep8speaks suggested fixes

* CHANGELOG.md upd
2020-04-10 11:43:06 -04:00
William Falcon 7857a73710
Update README.md 2020-04-10 09:55:42 -04:00
William Falcon e052883de7
Update README.md 2020-04-10 09:54:09 -04:00
William Falcon afc43dbba7
Update __init__.py 2020-04-10 08:43:46 -04:00
William Falcon 1f685c2882
fix pretty print (#1441)
* grid sample

* grid sample

* grid sample

* grid sample

* grid sample

* changelog

* version

Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-10 08:43:22 -04:00
Alex Sergeev 8dd9b80d7a
Fix gradient clipping (#1438)
* Fix gradient clipping

* Relax accuracy constraint
2020-04-09 21:08:28 -04:00
Jirka Borovec b2707c9b2e
fix retruning returns (#1431)
* returns

* changelog
2020-04-09 15:01:08 -04:00
William Falcon 2dec93f588
workers warning not on windows (#1433) 2020-04-09 14:46:51 -04:00
Jirka Borovec 17f58d2e11
add rank warning (#1428)
* add rank warning

* changelog

* use rank_zero_warn

* user trainer_init

* replace warnings

* fix test

* flake8

* docs

* changelog

* bug lol
2020-04-09 14:05:46 -04:00
William Falcon b4eb3884cf
workers warning not on windows (#1430) 2020-04-09 12:42:30 -04:00
William Falcon 21a1972921
fixed default sampler (#1425) 2020-04-09 08:52:15 -04:00
William Falcon b5c6d0e393
Update __init__.py 2020-04-08 14:44:14 -04:00
William Falcon 5b2351cbb9
added slurm doc (#1418)
* added slurm doc

* added slurm doc
2020-04-08 14:43:50 -04:00
William Falcon 764e7e12a7
Update __init__.py 2020-04-08 11:53:23 -04:00
Martin.B fb8d085b5f
Fix TrainsLogger doctest failing (switch to bypass mode in GitHub CI) (#1379)
* Fix TrainsLogger doctest failing (switch to bypass mode in GitHub CI)

* fix

* test ci

* debug

* debug CI

* Fix CircleCI

* Fix Any CI environment switch to bypass mode

* Removed debug prints

* Improve code coverage

* Improve code coverage

* Reverted

* Improve code coverage

* Test CI

* test codecov

* Codecov fix

* remove pragma

Co-authored-by: bmartinn <>
2020-04-08 11:52:52 -04:00
vguizilini 2ae2bd2b46
Print test results only if prog_bar_metrics is not empty (#1411)
* Print test results only if prog_bar_metrics is not empty

* Update evaluation_loop.py

Co-authored-by: vitor-guizilini <vitor.guizilini@tri.global>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-04-08 11:51:52 -04:00
William Falcon 7d0c2c7db8
Loader docs (#1416)
* added multiple loader docs

* added multiple loader docs

* added multiple loader docs

* added multiple loader docs

* added multiple loader docs

* Apply suggestions from code review

* added multiple loader docs

* added build docs script

* typo

* added build docs script

* added build docs script

* added build docs script

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-08 11:38:12 -04:00
david-alexander-white d8cbf8d60c
updated early stopping docs (#1410)
* remove incorrect comment in training_step

* added comment for on_batch_start in hooks.py

* update early stopping docs

* typo fix

* whitespace fix

* Apply suggestions from code review

* Update docs/source/early_stopping.rst

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-04-08 08:38:53 -04:00
Alexey Karnachev ddbf7de6dc
Added accumulation of loggers' metrics for the same steps (#1278)
* `add_argparse_args` method fixed (argument types added)

* autopep8 fixes

* --gpus=0 removed from test (for ci tests)

* Update pytorch_lightning/trainer/trainer.py

Co-Authored-By: Joe Davison <joe@huggingface.co>

* test_with_accumulate_grad_batches added

* agg_and_log_metrics logic added to the base logger class

* small format fix

* agg metrics strategies removed (not to complicate stuff)

* agg metrics: handle zero step

* autopep8

* changelog upd

* flake fix

* metrics aggregators factored out, metrics_agg.py added + tests

* metrics agg default value added

* Update pytorch_lightning/loggers/metrics_agg.py

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* metrics aggregators factored out, metrics_agg.py added + tests

* metrics agg default value added

* Update pytorch_lightning/loggers/metrics_agg.py

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* remove .item which causes sync issues (#1254)

* remove .item which causes sync issues

* fixed gradient acc sched

* fixed gradient acc sched

* test_metrics_agg.py removed (all tested in doctrings), agg metrics refactored

* test_metrics_agg.py removed (all tested in doctrings), agg metrics refactored

* autopep8

* loggers base.py types fixed

* test

* test

* metrics aggregation for loggers: each key now has a specific function (or default one)

* metrics aggregation for loggers: each key now has a specific function (or default one)

* docstrings upd

* manual typehints removed from docstrings

* batch_size decreased for test `test_with_accumulate_grad_batches`

* extend running accum

* refactor

* fix tests

* fix tests

* allowed_types generator scoped

* trainer.py distutils was imported twice, fixed

* TensorRunningAccum refactored

* TensorRunningAccum added to change log (Changed)

* change log pull link added

Co-authored-by: Joe Davison <joe@huggingface.co>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-08 08:35:47 -04:00
Adrian Wälchli 471499cd78
Temporary Fix for docs build failure (#1413)
* Update requirements.txt

* fix SG typo

Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-08 08:18:36 -04:00
Jirka Borovec f7622ebfca
fix SVG images (#1409) 2020-04-07 17:30:48 -04:00
Jirka Borovec 62822b6f73
fix missing images on pypi (#1407)
* formatting

* fix missing image on pypi

* fix pypi push
2020-04-07 15:42:19 -04:00
William Falcon fdb61cb854 release v0.7.2rc5 2020-04-07 14:41:00 -04:00
Jirka Borovec 466655bcda
release update (#1405)
* exclude tests

* compress image

* compress image

* update Manifest

* update action
2020-04-07 14:04:32 -04:00
Jirka Borovec b780807e73
release 0.7.2rc4 (#1402)
* instructions for changelog

* instructions for changelog

* on
2020-04-07 11:55:27 -04:00
William Falcon 0d2eb95530
Update __init__.py 2020-04-07 09:55:56 -04:00
William Falcon 5ace7d455d
Update __init__.py 2020-04-07 09:50:15 -04:00
Jirka Borovec b2ae57795f
add pypi user (#1401)
* add pypi user

* changelog

* changelog
2020-04-07 09:49:38 -04:00
William Falcon 91a4ea9b38
Update __init__.py 2020-04-07 09:16:02 -04:00
Jirka Borovec c3b82f0170
update Docs/changelog (#1398)
* update docs/changelog

* fix

Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-04-07 09:10:58 -04:00
Asaf Manor 09668df726
Update optimizers.py (#1383) 2020-04-07 09:09:23 -04:00
areshytko 495ffbd028
Tensorboard logger check if lightning_logs directory exists (#1377)
* tensorboard logger version if root_dir not exist

* update changelog

* resolve comments

Co-authored-by: Alexander Reshytko <areshytko@Alexanders-MacBook-Pro.local>
Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-04-07 06:39:54 -04:00
Paweł Rzepiński b8ff9bc1d2
Fix unimplemented type() on TPU (#1396)
* Fix unimplemented type() on TPU

* Add changelog entry

* Add quotation marks
2020-04-06 20:29:55 -04:00