TensorFlow2.0-Examples
TensorFlow2.0-Examples copied to clipboard
image_demo.py results in nan values in bboxes_pred
Hi, Thanks for this amazing project @YunYang1994 .
When using the image_demo.py, I'm getting the following warnings:
/yolov3-tf2-master/YunYang1994_TF2_YoloV3/TensorFlow2.0-Examples/4-Object_Detection/YOLOV3/core/utils.py:221: RuntimeWarning: invalid value encountered in maximum
pred_coor = np.concatenate([np.maximum(pred_coor[:, :2], [0, 0]),
/yolov3-tf2-master/YunYang1994_TF2_YoloV3/TensorFlow2.0-Examples/4-Object_Detection/YOLOV3/core/utils.py:222: RuntimeWarning: invalid value encountered in minimum
np.minimum(pred_coor[:, 2:], [org_w - 1, org_h - 1])], axis=-1)
/yolov3-tf2-master/YunYang1994_TF2_YoloV3/TensorFlow2.0-Examples/4-Object_Detection/YOLOV3/core/utils.py:228: RuntimeWarning: invalid value encountered in greater
scale_mask = np.logical_and((valid_scale[0] < bboxes_scale), (bboxes_scale < valid_scale[1]))
/yolov3-tf2-master/YunYang1994_TF2_YoloV3/TensorFlow2.0-Examples/4-Object_Detection/YOLOV3/core/utils.py:228: RuntimeWarning: invalid value encountered in less
scale_mask = np.logical_and((valid_scale[0] < bboxes_scale), (bboxes_scale < valid_scale[1]))
/yolov3-tf2-master/YunYang1994_TF2_YoloV3
And afterwards, I'm printing the pred_bbox and bboxes.
The predicted bboxes are almost all nans (and the value of bboxes doesn't matter because it uses pred_bbox):
tf.Tensor(
[[ nan nan nan ... nan
nan nan]
[ nan nan nan ... nan
nan nan]
[ nan nan nan ... nan
nan nan]
...
[3.8400000e+02 3.9251508e+02 2.5982959e+02 ... 1.7753243e-04
5.0899386e-04 7.8248978e-04]
[3.8401508e+02 3.8405893e+02 3.9810013e-02 ... 6.5720081e-04
1.8835366e-03 2.6790202e-03]
[3.8415375e+02 3.8413541e+02 7.9363394e-01 ... 1.9850866e-03
2.3146670e-03 3.1724779e-03]], shape=(10647, 15), dtype=float32)
The output image has no bboxes.
I'm using the weights that are downloaded from the link in your Readme file.