experiencor / keras-yolo3

Training and Detecting Objects with YOLO3
MIT License
1.61k stars 861 forks source link

ZeroDivisionError: float division by zero #331

Open joaoalves10 opened 2 years ago

joaoalves10 commented 2 years ago

Hi, i am implementing this repository to my data set. I have already done all steps without any error until the trainning. When i run the train.py, i have received 2 errors in differents runs:

  1. i have this error after the last epoch is completed: Traceback (most recent call last): File "/media/ciafa/toshiba_2tb_1/Yolo_repositorio/custom_yolov3/train.py", line 305, in main(args) File "/media/ciafa/toshiba_2tb_1/Yolo_repositorio/custom_yolov3/train.py", line 293, in main average_precisions = evaluate(infer_model, valid_generator) File "/media/ciafa/toshiba_2tb_1/Yolo_repositorio/custom_yolov3/utils/utils.py", line 48, in evaluate pred_boxes = get_yolo_boxes(model, raw_image, net_h, net_w, generator.get_anchors(), obj_thresh, nms_thresh)[0] File "/media/ciafa/toshiba_2tb_1/Yolo_repositorio/custom_yolov3/utils/utils.py", line 259, in get_yolo_boxes do_nms(boxes, nms_thresh)
    File "/media/ciafa/toshiba_2tb_1/Yolo_repositorio/custom_yolov3/utils/utils.py", line 166, in do_nms if bbox_iou(boxes[index_i], boxes[index_j]) >= nms_thresh: File "/media/ciafa/toshiba_2tb_1/Yolo_repositorio/custom_yolov3/utils/bbox.py", line 57, in bbox_iou return float(intersect) / union ZeroDivisionError: float division by zero

  2. The second issue is that the train in completed and the wieghts.h5 file is generated. However, in the end of the train, the mAP equals 0. I found it to be a little bit strange, so i ran the predict.py to confirm if the weights.h5 file was correctly generated, but it does no work, it gives me the same error showed in 1.

Can anyone help me with this issue?