svpino / tf_object_detection_cm

Confusion Matrix in Object Detection with TensorFlow
78 stars 36 forks source link

confusion_matrix_tf2.py:281: RuntimeWarning: invalid value encountered in double_scalars precision = float(confusion_matrix[id, id] / total_predicted) #42

Open td43 opened 2 years ago

td43 commented 2 years ago

Hi there,

I got this error at the last part of the confusion matrix.

Confusion Matrix:
[[0. 0. 0. ... 0. 0. 2.]
 [0. 0. 0. ... 0. 0. 5.]
 [0. 0. 0. ... 0. 0. 2.]
 ...
 [0. 0. 0. ... 0. 0. 7.]
 [0. 0. 0. ... 0. 0. 3.]
 [0. 0. 0. ... 0. 0. 0.]] 

confusion_matrix_tf2.py:281: RuntimeWarning: invalid value encountered in double_scalars
  precision = float(confusion_matrix[id, id] / total_predicted)
                                             category  precision_@0.5IOU  recall_@0.5IOU
0                         BARRILITOAL355ML--BARRILITO                NaN             0.0
1                     BARRILITONR325-444ML--BARRILITO                NaN             0.0
2                BARRILITONR6PACK325-444ML--BARRILITO                NaN             0.0
3                       BUDLIGHTAL355-473ML--BUDLIGHT                NaN             0.0

Do you have any idea what would might be?