【CV项目源码实现】Floating point exception (core dumped)
作者:互联网
前言
cmd
./darknet detector demo cfg/tfl.data cfg/yolov3-tiny-tfl.cfg backup/yolov3-tiny-tfl_500000.weights data/tfl.avi
error
Floating point exception (core dumped)avg_predictions(demo.c) ---> get_network_boxes(src/network.c) ----> fill_network_boxes(src/network.c) ----> get_yolo_detections(src/yolo_layer.c)----> correct_yolo_boxes(src/yolo_layer.c)
解决方法
使用gdb进行调试定位问题在orrect_yolo_boxes函数;
vi Makefile set DEBUG = 1 make -j8 # 重新编译 gdb ./darknet # set args detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg set args detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights test.mp4 r # 程序运行到crash
output
Thread 7269 "darknet" received signal SIGFPE, Arithmetic exception. [Switching to Thread 0x7ffefa91d000 (LWP 2491245)] 0x00005555555e96c9 in correct_yolo_boxes (dets=0x7ffdfc000c60, n=0, w=0, h=0, netw=416, neth=416, relative=1) at ./src/yolo_layer.c:257 257 new_w = (w * neth)/h;
原因分析
经过"排查过程",发现最终原因是src/yolo_layer.c文件中的correct_yolo_boxes函数发生了分母为0的除法,导致crash;
new_w = (w*neth)/h;
在correct_yolo_boxes函数最开始添加一条语句
if( 0==w || 0==h) return;
参考
1. yolo darknet 浮点数例外 核心存储 问题排查及解决方法;
完
标签:core,exception,yolov3,src,cfg,yolo,boxes,源码,correct 来源: https://www.cnblogs.com/happyamyhope/p/16580753.html