Commit Graph

128 Commits

Author SHA1 Message Date
Jihoon Lee d1200af358 fix model arguements (#5653) 2021-02-05 21:40:40 +01:00
chaton e425bf3ba9
[BugOnFeat] Resolve bug with Finetuning (#5744)
* resolve bug + add doc

* Update pytorch_lightning/callbacks/finetuning.py

* resolve bug

* start adding more test

* add more tests for finetuning callback functions

* rename to flatten_modules

* resolve doc

* Update pytorch_lightning/callbacks/finetuning.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* resolve comments

* remove update on BoringModel

* update on comments

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-02-04 18:36:54 +00:00
rohitgr7 a37416843b Fix sync
resolve wrong merge

tpu

yapf
2021-02-03 20:11:35 +01:00
Sidhant Sundrani 2b6738832b fix argparse conflicting options error (#5569)
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-02-03 19:41:46 +01:00
Sidhant Sundrani f72d93974c Fix command line run for refinforce_learn_qnet in pl_examples (#5414)
* fix wrong argument in argparse

* remove wrong default arg in argparser

* disable add help argparse
2021-02-03 19:41:46 +01:00
Jirka Borovec 21d313edc5
yapf examples (#5709) 2021-01-30 10:17:12 +00:00
Jirka Borovec 7e2e874d95
Refactor: legacy accelerators and plugins (#5645)
* tests: legacy

* legacy: accel

* legacy: plug

* fix imports

* mypy

* flake8
2021-01-26 20:04:36 -05:00
Arnaud Gelas fb6c33a52d Fix pre-commit trailing-whitespace and end-of-file-fixer hooks. (#5387)
(cherry picked from commit 4c6f36e6e1)
2021-01-26 14:27:56 +01:00
Jirka Borovec 2846322f60
fix docs render (#5610) 2021-01-25 20:21:00 -05:00
Sidhant Sundrani b5e7e030d4
add promxial policy optimization template to pl_examples (#5394)
* add ppo rl lightning template

* flake

* import gym without try as in qnet example

* fix import format

* remove torch.optim import, not required

* fix import format isort

* add trainer argparse

* change name of trajectory collection method

* add repo in references

* fix typo in comments

* use isinstance to verify actionspace type

* use fstring

* deduplication of logic code

* rename unused forloop variable

* use pl.seed_everything instead

* remove unused numpy import

* format string printed on error

* fix typo in comments

Co-authored-by: chaton <thomas@grid.ai>
2021-01-09 12:49:11 -05:00
chaton 48718d7ce7
Feat: Add BackboneLambdaFinetunningCallback (#5377)
* Feat: Add BackboneLambdaFinetunningCallback

* update changelog

* resolve pep8 and update changelog

* add finetunning example

* resolve example

* iremove milestones from model

* iupdate

* update

* Update pytorch_lightning/callbacks/__init__.py

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>

* Update pytorch_lightning/callbacks/__init__.py

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>

* update

* add comments

* resolve test

* Update pytorch_lightning/callbacks/finetuning.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* Update tests/trainer/logging/test_logger_connector.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* update on comments

* resolve merge

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2021-01-08 16:33:05 -05:00
Jirka Borovec 8a40e80226
fix num_workers for Windows example (#5375)
* fix num_workers for Windows example

* chlog

* Apply suggestions from code review

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* warn

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2021-01-06 19:28:30 -05:00
Jirka Borovec beb8cacf1c fix formatting - flake8 + isort 2021-01-06 21:31:48 +01:00
Carlos Mocholí 3ee3c42035 Prepare 1.1.3 release (#5365)
* Prepare 1.1.3 release

* Fix flake8 error

* suppress

* Remove 1.1.4 section

* Add missing commits to CHANGELOG

* Update PR template

* Add missing commit

* fix

* Update CHANGELOG.md

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

(cherry picked from commit 4d9db866a1)
2021-01-06 15:17:27 +01:00
J. Sebastian Paez 0e8ec93b28 black formatting and migrated to self.log logging in finetuning example (#5229)
* black formatting and migrated to self.log logging

* Apply suggestions from code review

Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>

* migrated to accuracy in the metrics package

migrated to accuracy in the metrics package

* removed trailing whitespace

* Apply suggestions from code review

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
(cherry picked from commit 17a0784c5e)
2021-01-06 12:49:31 +01:00
Jirka Borovec 53b0cb910b update isort config (#5335)
* update isort config

* apply

(cherry picked from commit 724f1051f0)
2021-01-06 12:49:23 +01:00
Akihiro Nitta abc690d720 Apply isort to `pl_examples/` (#5291)
* Remove examples from isort ignore list

* Apply isort

(cherry picked from commit 0c7c9e8540)
2021-01-06 12:47:53 +01:00
Jirka Borovec 74d0652164 flake8 ++ 2021-01-05 09:58:37 +01:00
Jirka Borovec 2438d7459b add doctests for example 2/n segmentation (#5083)
* draft

* fix

* drop folder

Co-authored-by: chaton <thomas@grid.ai>
2021-01-05 09:58:37 +01:00
Ganesh Anand a5b2392652 update DALIClassificationLoader to not use deprecated arguments (#4925)
* update DALIClassificationLoader to not use deprecated arguments

* fix line length

* dali version check added and changed args accordingly

* versions

* checking version using disutils.version.LooseVersion now

* .

* ver

* import

Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-01-05 09:58:37 +01:00
Jirka Borovec 518d915422 add doctests for example 1/n (#5079)
* define tests

* fix basic

* fix gans

* unet

* test

* drop

* format

* fix

* revert

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2021-01-05 09:58:37 +01:00
Jirka Borovec 3b83666823 prune ecosystem example (#5085)
* draft

* wip

* CI

* drop pl geometry

* copy

* logo
2021-01-05 09:58:37 +01:00
Jirka Borovec 0f36525e8f
fix/enable - check F401 (#5201)
* refactor - check F401

* missed

* fix
2020-12-21 10:15:04 +01:00
Jirka Borovec 35fd6e93c7
refactor - check E501 (#5200) 2020-12-21 14:23:09 +05:30
Jirka Borovec 059eaecbb4
set xxx_AVAILABLE as protected (#5082)
* sett xxx_AVAILABLE as protected

* docs
2020-12-14 20:19:05 +05:30
Jirka Borovec 77fb425dd4
update usage of deprecated profiler (#5010)
* drop deprecated profiler

* lut

Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
2020-12-10 08:38:14 +01:00
chaton ef8ef12fd0
[feat] pp 2/n (#5026)
* Added changes for RPC plugin

* Add missing kwargs

* Fix code format

* Loading refactors by introducing is_distributed var, fix optimizer step flow

* Add rpc guard

* Added docstrings and typing

* resolve comments

* Add additional rpc hook, refactor name of exit process hook for clarity

* remove annotation

* Modify behaviour to allow optional return, add test for rpc plugin

* resolve tests

* rename is_ddp_based

* update

* update for windows

* update

* resolve test

* code smell

* Added sequential plugin

* resolve bug

* update

* cleanup

* add Exception

* resolve docs

* Remove ddp support

* Revert distributed -> ddp

* Update pl_examples/basic_examples/conv_sequential_example.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update pl_examples/basic_examples/conv_sequential_example.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Address code review points

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Add missing return

* Fix formatting, add datamodule args

* add small comment

* resolve comments

* resolve comments

* update source for fairscale

* update extras

* remove staticmethod

* resolve flake8

* Skip tests that are failing due to bug upstream with multiple optimizers and shard

* update

* update on comments

* clean test

* latest comments

* remove old comments

* add todo

* Update version

* update

* resolve bugs

* resolve bugs

* update test

* remove hanging test

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* resolve on comments

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* resolve on comments

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* Update pytorch_lightning/plugins/ddp_sequential_plugin.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* remove ImportError

Co-authored-by: SeanNaren <sean@grid.ai>
Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2020-12-09 12:56:51 +00:00
Jirka Borovec 53d7c9555c
drop usage of deprecated distributed_backend (#5009)
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
2020-12-09 09:18:23 +01:00
Jirka Borovec 22bd742214
fix examples running in DP (#4764)
* add option to step result to do aggregation on a specific device

* in dp: do aggregation on root gpu

* Update CHANGELOG.md

* pep8

* trailing whitespace

* uncomment DP

* more cases

* tmpdir

* test

* note

* move to root


move result


stupid result object


revert to master


undo import


add "to" method to result


generalize to


try a test


try a test


Revert "try a test"

This reverts commit 22e3c1001e6c5774ea18ad925830304c245bf145.

Revert "try a test"

This reverts commit 4d2d8fb2a52d552894809a0cbe51af126d78f070.

new test


max epochs


super epoch end 


log in test


hanging test


undo test


initial test that fails on master


step end


pass


step end


step end


epoch end


print


step


check dev


clean up test


sanity check


wtf is go ing on


frustration


debugging test


test


test


test


test


test


test


test


test


unused import

* dist backend -> accelerator

* remove todo

Co-authored-by: Justus Schock <justus.schock@rwth-aachen.de>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2020-12-04 23:32:00 +01:00
Sean Naren ed5bda3eda
[docs] Added description of saving using ddp (#4660)
* Added description of saving using ddp

* Added code block example to explain DDP saving logic

* Fixed underline

* Added verbose explanation

* Apply suggestions from code review

* Added caveat when using custom saving functions

* flake8

Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
2020-12-04 17:59:38 +01:00
Limber Cheng b807c3278d
Update to latest logging format and modify the accuracy method. (#4816)
* Update to latest logging format and modify the accuracy method.

* Apply suggestions from code review

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
2020-12-04 15:30:51 +01:00
Lucien d3626b7f50
Organize docstring (#4906)
* Organize docstring

* Update pl_examples/domain_templates/reinforce_learn_Qnet.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
2020-12-04 14:45:13 +01:00
brett koonce 4de568a545
tweak imagenet docs to match current script (#4895)
Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
2020-11-30 09:54:55 +01:00
Lucien-cs ac3f1bd0da
Update reinforce_learn_Qnet.py (#4814)
Correct the text.

Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
2020-11-30 08:21:37 +01:00
Jirka Borovec 94a9d3d283
Update examples - use DataModule (#4740)
* rename

* add mnist_datamodule.py

* dm

* fix

* imports

* clean

* imports

* transforms

* skip
2020-11-20 23:40:40 +05:30
chaton b7601e9deb
[Example] Add Pytorch Geometric Example (#4568)
* add example for Pytorch Geometric

* remove hydra

* add docstring

* remove description

* rename folder

* update script to not break test

* remove .lock

* add Pytorch Geometric to doc

* add docstring at the begining

* add comments

* Update pl_examples/pytorch_ecosystem/pytorch_geometric/README.md

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update pl_examples/pytorch_ecosystem/pytorch_geometric/README.md

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* Update pl_examples/pytorch_ecosystem/pytorch_geometric/cora_dna.py

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* add toml

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka Borovec <jirka@pytorchlightning.ai>
2020-11-18 20:03:55 +00:00
Jirka Borovec 9a5d40aff4
test PL examples (#4551)
* test PL examples

* minor formatting

* skip failing

* skip failing

* args

* mnist datamodule

* refactor tests

* refactor tests

* skip

* skip

* drop DM

* drop DM

Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
2020-11-17 19:35:17 +01:00
Ludger Paehler 7c4356464c
Minor typo in the description of Adam's beta 2 (#4715)
Adam's beta 2 parameter was mistakenly referred to as the first order momentum of the gradient, whereas it should be the second order momentum. This has no effect on the correct working of the example.
2020-11-17 17:00:36 +01:00
edenlightning 53f14391da
Rename distributed_backend to accelerator in examples (#4657)
* Rename distributed_backend to accelerator

* Update submit_ddp2_job.sh

* Update 05-trainer-flags-overview.ipynb

Co-authored-by: Jeff Yang <ydcjeff@outlook.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
2020-11-15 15:47:14 +01:00
Indrayana Rustandi 6e5f232f5c
Add Dali MNIST example (#3721)
* add MNIST DALI example, update README.md

* Fix PEP8 warnings

* reformatted using black

* add mnist_dali to test_examples.py

* Add documentation as docstrings

* add nvidia-pyindex and nvidia-dali-cuda100

* replace nvidia-pyindex with --extra-index-url

* mark mnist_dali test as Linux and GPU only

* adjust CUDA docker and examples.txt, fix import error in test_examples.py

* adjust the GPU check

* Exit when DALI is not available

* remove requirements-examples.txt and DALI pip install

* Refactored example, moved to new logging api, added runtime check for test and dali script

* Patch to reflect the mnist example module

* add req.

* Apply suggestions from code review

* Removed requirement as it breaks CPU install, added note in README to install DALI

* add DALI to Drone

* test examples

* Apply suggestions from code review

* imports

* ABC

* cuda

* cuda

* pip DALI

* Move build into init function

Co-authored-by: SeanNaren <sean@grid.ai>
Co-authored-by: Jirka Borovec <jirka@pytorchlightning.ai>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
2020-11-06 14:53:46 +00:00
chaton a32bffcdea
feature/ Add note about Argparse. (#4321)
* add a note about argparse

* update

Co-authored-by: Jeff Yang <ydcjeff@outlook.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2020-11-03 23:40:51 +06:30
Sahin Kureta 90bb7b1fbb
update examples (#4233)
* Removed image generation inside the training step.

It was overwriting the image grid generated in `on_epoch_end`. I also made `adversarial_loss` a static method.

* Incorporated Hyperparameter best practices

Using ArgumentParser and hparams as defined in the Hyperparameters section of
the documentation. This way we can set trainer flags (such as precision,
and gpus) from the command line.

* Incorporated Hyperparameter best practices

Using ArgumentParser and hparams as defined in the Hyperparameters section of
the documentation. This way we can set trainer flags (such as precision,
and gpus) from the command line.

* Split the data part into a LightningDataModule

* Update pl_examples/domain_templates/generative_adversarial_net.py

Co-authored-by: Jeff Yang <ydcjeff@outlook.com>
2020-10-21 18:07:18 +02:00
Jirka Borovec 8873750cf0
remove deprecated early_stop_callback (#3982) 2020-10-08 06:30:33 -04:00
William Falcon 04303b3a2e
added bug report model (#3901) 2020-10-06 09:05:20 -04:00
William Falcon a28528cc8b
ref: remove weight loading hack for ddp_cpu (#3808) 2020-10-02 19:28:50 -04:00
William Falcon 440f837f6d
ref: part a of #3733 (#3766)
* ref: part a of #3733

* ref: part a of #3733
2020-10-01 08:15:23 -04:00
William Falcon 7c61fc7c27
ref: fixes logging for eval steps (#3763)
* fixes logging for eval steps
2020-10-01 02:31:11 -04:00
William Falcon 00ba2b24b7
Drop all result docs. Make the separation between flow and logging clear (#3744)
* remove results docs. separate flow from log
2020-09-30 08:31:16 -04:00
Jirka Borovec aa52c930f4
test examples (#3643)
* test examples

* testing

* testing

* typo

* req

* exception

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2020-09-24 17:33:11 +02:00
William Falcon c94c0a2b1e
fix examples (#3631)
* fix examples

* fix examples
2020-09-23 17:58:03 -04:00