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

ZeroDivisionError: float division by zero #331

Open
joaoalves10 opened this issue Apr 6, 2022 · 0 comments
Open

ZeroDivisionError: float division by zero #331

joaoalves10 opened this issue Apr 6, 2022 · 0 comments

Comments

@joaoalves10
Copy link

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?

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

1 participant