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

RuntimeWarning: invalid value encountered in double_scalars #22

Open
acikgozf opened this issue Jan 18, 2020 · 4 comments
Open

RuntimeWarning: invalid value encountered in double_scalars #22

acikgozf opened this issue Jan 18, 2020 · 4 comments

Comments

@acikgozf
Copy link

Confusion Matrix:
[[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0.]]

confusion_matrix.py:115: RuntimeWarning: invalid value encountered in double_scalars
precision = (confusion_matrix[id, id] / total_predicted)
confusion_matrix.py:116: RuntimeWarning: invalid value encountered in double_scalars
recall = (confusion_matrix[id, id] / total_target)
category precision_@0.5IOU recall_@0.5IOU
0 Her2 NaN NaN
1 LuminalA NaN NaN
2 LuminalB NaN NaN
3 Triple NaN NaN

@svpino
Copy link
Owner

svpino commented Jan 19, 2020

Can you provide more information so I can try to reproduce your problem?

@MuhammadAliShahzad
Copy link

@svpino
This is a division by Zero error. on line 121
precision = float(confusion_matrix[id, id] / total_predicted)
If you fix the division by zero, this should solve the problem
if total_predicted == 0: precision = 0.0 else: precision = float(confusion_matrix[id, id] / total_predicted)

@svpino
Copy link
Owner

svpino commented Feb 18, 2020 via email

@ghost
Copy link

ghost commented Aug 8, 2020

Hi @svpino if i have ground truth and prediction value both in txt file then how can i used your repo? can you please explained me. Help is deep appreciate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants