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

F beta with macro computation outputs nans for certain inputs #4187

Closed
abhinavg97 opened this issue Oct 16, 2020 · 1 comment · Fixed by #4183
Closed

F beta with macro computation outputs nans for certain inputs #4187

abhinavg97 opened this issue Oct 16, 2020 · 1 comment · Fixed by #4183
Labels
bug Something isn't working help wanted Open to be worked on
Milestone

Comments

@abhinavg97
Copy link
Contributor

abhinavg97 commented Oct 16, 2020

🐛 Bug

Please reproduce using the BoringModel and post here

https://colab.research.google.com/drive/1108mj1bKob0QpGlq2Q09L7ulmPDE49D1?usp=sharing

To Reproduce

p = torch.Tensor([[0,0],[0,1]])
t = torch.Tensor([[0,1],[1,0]])
f_beta = Fbeta(num_classes=len(t[0]), average='macro', multilabel=True)
f_beta(p, t)

> tensor(nan)

Expected behavior

tensor(0)

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 Lightning Version: 1.0.1
  • PyTorch Version (e.g., 1.0):
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, source):
  • Build command you used (if compiling from source):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

@abhinavg97 abhinavg97 added bug Something isn't working help wanted Open to be worked on labels Oct 16, 2020
@abhinavg97
Copy link
Contributor Author

Fixed the issue with #4183

@edenlightning edenlightning added this to the 1.0.3 milestone Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants