Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix backward compatability for older versions of lightning #182

Merged
merged 14 commits into from
Apr 20, 2021
Merged

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Apr 19, 2021

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Fixes #152

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #182 (bb78a9d) into master (bc5f9a9) will decrease coverage by 8.30%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
- Coverage   96.01%   87.70%   -8.31%     
==========================================
  Files         180      180              
  Lines        5744     5750       +6     
==========================================
- Hits         5515     5043     -472     
- Misses        229      707     +478     
Flag Coverage Δ
Linux 79.33% <78.57%> (+0.05%) ⬆️
Windows 79.33% <78.57%> (+0.05%) ⬆️
cpu 79.33% <78.57%> (-16.66%) ⬇️
gpu 96.04% <ø> (+0.01%) ⬆️
macOS 79.33% <78.57%> (-16.66%) ⬇️
pytest 87.70% <78.57%> (-8.31%) ⬇️
python3.6 ?
python3.8 ?
python3.9 ?
torch1.3.1 ?
torch1.8.1 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
torchmetrics/classification/accuracy.py 72.54% <0.00%> (-23.61%) ⬇️
torchmetrics/functional/classification/accuracy.py 57.57% <ø> (-36.37%) ⬇️
torchmetrics/utilities/imports.py 85.29% <80.00%> (+3.15%) ⬆️
torchmetrics/metric.py 55.84% <100.00%> (-39.31%) ⬇️
torchmetrics/utilities/distributed.py 22.85% <0.00%> (-74.29%) ⬇️
torchmetrics/classification/auc.py 47.61% <0.00%> (-52.39%) ⬇️
torchmetrics/functional/classification/auroc.py 46.15% <0.00%> (-40.01%) ⬇️
torchmetrics/functional/regression/psnr.py 60.60% <0.00%> (-36.37%) ⬇️
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc5f9a9...bb78a9d. Read the comment docs.

@Borda Borda added bug / fix Something isn't working Priority Critical task/issue labels Apr 19, 2021
@Borda Borda added this to the 0.3 milestone Apr 19, 2021
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

can we also add an integration test for this as we have tested with PL 1.2 and they were all passing...

@Borda
Copy link
Member

Borda commented Apr 19, 2021

The problem seems to be cyclic import as the available func tries to import the package but in PL case it has TM as a dependency...

@Borda Borda enabled auto-merge (squash) April 19, 2021 21:25
@Borda Borda added ready and removed ready labels Apr 19, 2021
@Borda
Copy link
Member

Borda commented Apr 19, 2021

@SkafteNicki seems that the integration fails... mind check it?

@pep8speaks
Copy link

pep8speaks commented Apr 20, 2021

Hello @SkafteNicki! Thanks for updating this PR.

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

Comment last updated at 2021-04-20 09:08:09 UTC

@Borda Borda merged commit 7115789 into master Apr 20, 2021
@Borda Borda deleted the logger_fix branch April 20, 2021 09:32
Comment on lines +260 to +263
# lower lightning versions requires this implicitly to log metric objects correctly
# in self.log
if not _LIGHTNING_AVAILABLE or _LIGHTNING_GREATER_EQUAL_1_3:
self._computed = None
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this backwards? shouldn't lightning be accounting for the torchmetrics version, not the other way around?

Copy link
Member Author

Choose a reason for hiding this comment

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

since we cannot change earlier versions of lightning, we need to do the change in torchmetrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working Priority Critical task/issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retrieval metrics problem with pytorch lightning integration in compute()
5 participants