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

UserWarning at functional confusion_matrix function #1064

Closed
Kr4is opened this issue Jun 3, 2022 · 4 comments · Fixed by #1058
Closed

UserWarning at functional confusion_matrix function #1064

Kr4is opened this issue Jun 3, 2022 · 4 comments · Fixed by #1058
Labels
bug / fix Something isn't working help wanted Extra attention is needed

Comments

@Kr4is
Copy link

Kr4is commented Jun 3, 2022

🐛 Bug

When executing the function 'confusion_matrix' of the functional module, a UserWarning appears:

UserWarning: Torchmetrics v0.9 introduced a new argument class property called `full_state_update` that has
                not been set for this class (_ResultMetric). The property determines if `update` by                                                                                                                                                                                                                            
                default needs access to the full metric state. If this is not the case, significant speedups can be                                                                                                                                                                                                            
                achieved and we recommend setting this to `False`.                                                                                             
                We provide an checking function                                                                                                                
                `from torchmetrics.utilities import check_forward_no_full_state`                                                                               
                that can be used to check if the `full_state_update=True` (old and potential slower behaviour,                                                                                                                                                                                                                 
                default for now) or if `full_state_update=False` can be used safely.

This call does not allow the full_state_update parameter to be passed, so as users we have no way to change this behaviour. So, we should not show a user warning.

To Reproduce

Simply run the confusion_matrix function of the functional module

Code sample

confusion_matrix = torchmetrics.functional.confusion_matrix( preds, targets, num_classes=len(self.classes))

Expected behavior

A UserWarning is not displayed when executing this function.

Environment

  • TorchMetrics version (and how you installed TM, e.g. conda, pip, build from source): pip
  • Python & PyTorch Version (e.g., 1.0): python3.8, pytorch 1.11
  • Any other relevant information such as OS (e.g., Linux): Linux (ubuntu20.04)
@Kr4is Kr4is added bug / fix Something isn't working help wanted Extra attention is needed labels Jun 3, 2022
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

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

@SkafteNicki
Copy link
Member

Will be fixed by PR #1058

@tsteffek
Copy link

tsteffek commented Jun 5, 2022

There's also a warning with MeanMetric (and I assume all Aggregators, since full_state_update doesn't appear within the aggregation file). Not entirely sure whether this is related or a separate issue.

@SkafteNicki
Copy link
Member

Hi @tsteffek,
It is the same issue since we have not been strict enough to test the new full_state_update feature. It will be added to aggregation metrics in PR #1070 (along some other changes to aggregation metrics).

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 help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants