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

Segmentation fault (core dumped) #23

Open
xyqqqfs opened this issue Mar 27, 2022 · 3 comments
Open

Segmentation fault (core dumped) #23

xyqqqfs opened this issue Mar 27, 2022 · 3 comments

Comments

@xyqqqfs
Copy link

xyqqqfs commented Mar 27, 2022

博主的demo已经跑通了,但是换成自己的模型和数据集后,make成功了但是运行“./detect_test”时出错:“Segmentation fault (core dumped)”,其中已经把main.cpp的xml和图片路径以及detector.cpp的类别数都改了,请问有没有人遇到这样的情况?

@gcusms
Copy link

gcusms commented Apr 12, 2022

有,一模一样

@gcusms
Copy link

gcusms commented Apr 12, 2022

34531 Segmentation fault (core dumped)

@ChesterXcw
Copy link

ChesterXcw commented Jul 5, 2022

博主的demo已经跑通了,但是换成自己的模型和数据集后,make成功了但是运行“./detect_test”时出错:“Segmentation fault (core dumped)”,其中已经把main.cpp的xml和图片路径以及detector.cpp的类别数都改了,请问有没有人遇到这样的情况?

同样遇到此问题,问题应该出现在这,s[i]访问越界,你可以打印出blob的值(正常应为80,40,20)查看,报错时应该打印了除(80,40,20) 以外的数值

parse_yolov5(blob,s[i],_cof_threshold,origin_rect,origin_rect_cof);

如下是我的修改,修改完成后重新make,没有再出现报错。

    int i = 0;
    for (auto &output : _outputinfo) {
        auto output_name = output.first;
        Blob::Ptr blob = infer_request->GetBlob(output_name);
       
        const int net_grid_h = static_cast<int>(blob->getTensorDesc().getDims()[2]); 
        const int net_grid_w = static_cast<int>(blob->getTensorDesc().getDims()[3]);

        if(net_grid_h != net_grid_w){continue;};
        parse_yolov5(blob,s[i],_cof_threshold,origin_rect,origin_rect_cof, classId);
        ++i;
    }

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

3 participants