Skip to content

Conversation

@tadejsv
Copy link
Contributor

@tadejsv tadejsv commented Dec 26, 2020

This fixes an issue that occurs when the default value of a metric state was list(), but the current value of the state was a tensor (this happens, for example, after syncing the state in ddp with reduction method "cat"). On reset this would attempt to move the empty list to self.device using .to() - which would throw an error.

I've also updated the docstring so that it is clear that "cat" is to be used with list states.

@pep8speaks
Copy link

pep8speaks commented Dec 26, 2020

Hello @tadejsv! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-12-29 15:43:51 UTC

@codecov
Copy link

codecov bot commented Dec 26, 2020

Codecov Report

Merging #5273 (78707df) into master (dabfeca) will decrease coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #5273   +/-   ##
======================================
- Coverage      93%     93%   -0%     
======================================
  Files         134     134           
  Lines        9950    9950           
======================================
- Hits         9261    9254    -7     
- Misses        689     696    +7     

Copy link
Contributor

@teddykoker teddykoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Thanks :)

@ananyahjha93 ananyahjha93 merged commit 4913cbb into Lightning-AI:master Dec 29, 2020
Borda pushed a commit that referenced this pull request Jan 6, 2021
* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>
(cherry picked from commit 4913cbb)
asnorkin pushed a commit to asnorkin/pytorch-lightning that referenced this pull request Jan 15, 2021
* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>
asnorkin pushed a commit to asnorkin/pytorch-lightning that referenced this pull request Feb 8, 2021
* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>
asnorkin pushed a commit to asnorkin/pytorch-lightning that referenced this pull request Feb 9, 2021
* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>
asnorkin pushed a commit to asnorkin/pytorch-lightning that referenced this pull request Feb 16, 2021
* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>
asnorkin pushed a commit to asnorkin/pytorch-lightning that referenced this pull request Feb 17, 2021
* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>
rohitgr7 added a commit that referenced this pull request Feb 22, 2021
* Trainer.test should return only test metrics (#5214)

* resolve bug

* merge tests

* Fix metric state reset (#5273)

* Fix metric state reset

* Fix test

* Improve formatting

Co-authored-by: Ananya Harsh Jha <[email protected]>

* print() method added to ProgressBar

* printing alongside progress bar added to LightningModule.print()

* LightningModule.print() method documentation updated

* ProgressBarBase.print() stub added

* stub

* add progress bar tests

* fix isort

* Progress Callback fixes

* test_metric.py duplicate DummyList removed

* PEP and isort fixes

* CHANGELOG updated

* test_progress_bar_print win linesep fix

* test_progress_bar.py remove whitespaces

* Update CHANGELOG.md

Co-authored-by: chaton <[email protected]>
Co-authored-by: Tadej Svetina <[email protected]>
Co-authored-by: Ananya Harsh Jha <[email protected]>
Co-authored-by: Alexander Snorkin <[email protected]>
Co-authored-by: rohitgr7 <[email protected]>
Co-authored-by: Adrian Wälchli <[email protected]>
Co-authored-by: Carlos Mocholí <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants