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

[Bug]: torchmetrics.functional.auc deprecated #750

Closed
1 task done
Anurag-Shah opened this issue Nov 30, 2022 · 5 comments
Closed
1 task done

[Bug]: torchmetrics.functional.auc deprecated #750

Anurag-Shah opened this issue Nov 30, 2022 · 5 comments

Comments

@Anurag-Shah
Copy link

Describe the bug

Needs to be replaced with torchmetrics.utilities.compute.auc

Affects following files:

  • anomalib/utils/metrics/aupr.py
  • anomalib/utils/metrics/aupro.py
  • anomalib/utils/metrics/auroc.py

Dataset

N/A

Model

N/A

Steps to reproduce the behavior

Just try to run any dataset on a fresh install (in a fresh conda environment).

OS information

OS information:

  • OS: [e.g. Ubuntu 20.04]
  • Python version: [e.g. 3.8.10]
  • Anomalib version: [e.g. 0.3.6]
  • PyTorch version: [e.g. 1.9.0]
  • CUDA/cuDNN version: [e.g. 11.1]
  • GPU models and configuration: [e.g. 2x GeForce RTX 3090]
  • Any other relevant information: [e.g. I'm using a custom dataset]

Expected behavior

There should not be a runtime error when importing the auc function

Screenshots

N/A

Pip/GitHub

GitHub

What version/branch did you use?

No response

Configuration YAML

N/A

Logs

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jpcbertoldo
Copy link
Contributor

@ashwinvaidya17

How much effort would it be?
Just wondering.

Another suggestion: as this will be corrected, maybe could we rename the classes in

anomalib/utils/metrics/aupr.py
anomalib/utils/metrics/auroc.py

To something that does not shadow torchmetrics?
It's a bit confusing to have AUROC(ROC) while you find exactly the same thing in tochmetrics -- maybe AnomalibAUROC?

@Anurag-Shah
Copy link
Author

I made these edits myself when running the github locally. It's just changing the name of the import, from
"from torchmetrics.functional import auc"
to
"from torchmetrics.utilities.compute import auc"

Not really any work at all.

But yes, as mentioned, the version change also breaks the CLI and I didn't try to fix that. I used the tools/train.py and didn't need to make any other edits to get it to work besides this. Didn't think about downgrading my torchmetrics version lol

@ashwinvaidya17
Copy link
Collaborator

@jpcbertoldo like @Anurag-Shah mentioned just changing the import does not work. There are a few more places where we have to make changes. I haven't investigated it thoroughly but for now we have fixed the torchmetrics version to 0.10.3 in this PR #754.
Renaming the classes is a good idea. We will discuss it when we upgrade the torchmetrics version.

@jpcbertoldo
Copy link
Contributor

jpcbertoldo commented Dec 12, 2022

... the version change also breaks the CLI and I didn't try to fix that.

I was referring to this in the "how much effort".

I haven't investigated it thoroughly ...

Ok, 👍 !

Let's wait and see then :)

Renaming the classes is a good idea. We will discuss it when we upgrade the torchmetrics version.

Please 🙏 !

@ashwinvaidya17
Copy link
Collaborator

Closing as this will be addressed by #1879

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 a pull request may close this issue.

3 participants