You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for creating this great package! I've encountered an issue (bug?) when trying to integrate torchmetrics' metrics with the LightningCLI of pytorch lightning.
When using the Precision class (and I suspect many others have the same behaviour (?), I'm hindered by the following (see further below why):
Why it matters: I'm trying to use metrics together with the LightningCLI (which I assume could be considered a standard use-case?), as I want to define my metrics in my yaml configuration file. Ignoring everything else, this is an example structure in my yaml:
Unfortunately, in my error message I get the following: Import path torchmetrics.Precision does not correspond to a subclass of <class 'torchmetrics.metric.Metric'>
To Reproduce
See above.
Expected behavior
Considering the documentation encourages to use the top-level class with the task= argument and class types matter in the Lightning ecosphere, I would expect torchmetrics' metrics to work with the LightningCLI, meaning that torchmetrics.Precision is considered a Metric by the CLI type-checker.
Environment
python 3.8, set-up with conda, but pip installed the following:
🐛 Bug
Thanks for creating this great package! I've encountered an issue (bug?) when trying to integrate torchmetrics' metrics with the LightningCLI of pytorch lightning.
When using the Precision class (and I suspect many others have the same behaviour (?), I'm hindered by the following (see further below why):
while of course the actual class you get back after dispatching for the right task (
multilabel
in my case):Why it matters: I'm trying to use metrics together with the LightningCLI (which I assume could be considered a standard use-case?), as I want to define my metrics in my yaml configuration file. Ignoring everything else, this is an example structure in my yaml:
and this is the type hint in my LightningModule:
Unfortunately, in my error message I get the following:
Import path torchmetrics.Precision does not correspond to a subclass of <class 'torchmetrics.metric.Metric'>
To Reproduce
See above.
Expected behavior
Considering the documentation encourages to use the top-level class with the
task=
argument and class types matter in the Lightning ecosphere, I would expect torchmetrics' metrics to work with the LightningCLI, meaning thattorchmetrics.Precision
is considered a Metric by the CLI type-checker.Environment
python 3.8, set-up with conda, but pip installed the following:
The text was updated successfully, but these errors were encountered: