Lightning-AI / torchmetrics

Torchmetrics - Machine learning metrics for distributed, scalable PyTorch applications.
https://lightning.ai/docs/torchmetrics/
Apache License 2.0
2.08k stars 402 forks source link

Unable to unpickle a MatthewsCorrCoef saved object #1260

Closed okbalefthanded closed 1 year ago

okbalefthanded commented 1 year ago

🐛 Bug

Matthews Correlation coefficient requires a positional argument num_classes, so it raises a TypeError: missing 1 required positional argument: 'num_classes'

To Reproduce

Steps to reproduce the behavior...

The error is reported in this colab notebook : https://colab.research.google.com/drive/1UvhPyPbzpF61SY-51ti8R_O-Vc2FP-vO?usp=sharing

Expected behavior

We expect the same behaviour as in v 0.9.3.

Environment

github-actions[bot] commented 1 year ago

Hi! thanks for your contribution!, great first issue!

stancld commented 1 year ago

@SkafteNicki

SkafteNicki commented 1 year ago

Hi @okbalefthanded, thanks for raising this issue. Happy to report that it has already been solve in PR #1250. To fix the issue you can upgrade to master for now:

pip install https://github.com/Lightning-AI/metrics/archive/master.zip

or wait until the next bugfix release. Closing issue.