Skip to content

error when using auroc #4293

@stevejpurves

Description

@stevejpurves

I may be using auroc incorrectly, but this seems like a bug, which is reproducable using the boring model example for tensors with ndim > 1

🐛 Bug

Using the auroc() metric results in an error:
RuntimeError: Boolean value of Tensor with more than one value is ambiguous

Please reproduce using the BoringModel and post here

https://colab.research.google.com/drive/1Dc5cVu8FZN1C2ZnH4ZH-ouG2II1dt4FE?usp=sharing

Expected behavior

It should work as is?
this line

https://github.com/PyTorchLightning/pytorch-lightning/blob/96785b99df878ebc45bc455eb7902a6dd4661139/pytorch_lightning/metrics/functional/classification.py#L892

should use torch.any()?

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/PyTorchLightning/pytorch-lightning/master/tests/collect_env_details.py
# For security purposes, please check the contents of collect_env_details.py before running it.
python collect_env_details.py
  • PyTorch Version (e.g., 1.0): 1.6.0
  • OS (e.g., Linux): mac
  • How you installed PyTorch (conda, pip, source): conda
  • Build command you used (if compiling from source):
  • Python version: 3.8
  • CUDA/cuDNN version: none
  • GPU models and configuration: none
  • Any other relevant information: none

Additional context

also reproducible here:

Screenshot 2020-10-21 at 22 07 25

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs an improvement or enhancementhelp wantedOpen to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions