ChenYingpeng / caffe-yolov3

A real-time object detection framework of Yolov3/v4 based on caffe
472 stars 230 forks source link

Segment fault #80

Closed WorstCodeWay closed 4 years ago

WorstCodeWay commented 4 years ago

Hi, all. What is this segment fault about? I know few about it, please somebody help me.

Executed command:

./x86_64/bin/demo ../prototxt/yolov3.prototxt ../caffemodel/yolov3.caffemodel ../images/dog.jpg

Runtime error:

I0927 15:11:27.391306 15802 net.cpp:131] Top shape: 1 128 76 76 (739328)
I0927 15:11:27.391309 15802 net.cpp:139] Memory required for data: 805867520

Thread 1 "demo" received signal SIGSEGV, Segmentation fault.
0x00007ffff4e61bb3 in std::vector<bool, std::allocator<bool> >::push_back(bool) () from /home/lihuawei/Documents/01_Gits/caffe/distribute/lib/libcaffe.so.1.0.0
(gdb) bt
#0  0x00007ffff4e61bb3 in std::vector<bool, std::allocator<bool> >::push_back(bool) () from /home/lihuawei/Documents/01_Gits/caffe/distribute/lib/libcaffe.so.1.0.0
#1  0x00007ffff4e65c15 in caffe::Net<float>::AppendParam(caffe::NetParameter const&, int, int) () from /home/lihuawei/Documents/01_Gits/caffe/distribute/lib/libcaffe.so.1.0.0
#2  0x00007ffff4e6882a in caffe::Net<float>::Init(caffe::NetParameter const&) () from /home/lihuawei/Documents/01_Gits/caffe/distribute/lib/libcaffe.so.1.0.0
#3  0x00007ffff4e6ae40 in caffe::Net<float>::Net(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, caffe::Phase, int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const*) ()
   from /home/lihuawei/Documents/01_Gits/caffe/distribute/lib/libcaffe.so.1.0.0
#4  0x00007ffff7b4e286 in Detector::Detector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int) () from /home/lihuawei/Documents/01_Gits/caffe-yolov3/build/x86_64/lib/libyolov3-plugin.so
#5  0x000055555555e9ba in main ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 15802] will be killed.

Quit anyway? (y or n) y

By the way, my model and weights are converted from darknet. And last a few lines of output from that converter like:

I0927 15:16:20.021044 15864 net.cpp:244] This network produces output layer82-conv
I0927 15:16:20.021049 15864 net.cpp:244] This network produces output layer94-conv
I0927 15:16:20.021152 15864 net.cpp:257] Network initialization done.
unknow layer type yolo 
('upsample:', 86)
unknow layer type yolo 
('upsample:', 98)
unknow layer type yolo 
unknow layer type yolo 
unknow layer type yolo 
save prototxt to prototxt/yolov3.prototxt
save caffemodel to yolov3.caffemodel

Append: Just now, I try the caffe model and prototext downloaded from netdisk offerred by @ChenYingpeng , all tries have the same error "segmentation fault(core dump)"

ChenYingpeng commented 4 years ago

@WorstCodeWay Please check your device compute_sm in CMakeLists.txt, such as -gencode arch=compute_61,code=sm_61 #gtx 1060.

WorstCodeWay commented 4 years ago

@WorstCodeWay Please check your device compute_sm in CMakeLists.txt, such as -gencode arch=compute_61,code=sm_61 #gtx 1060.

Sorry, cannot follow you by "check your device compute_sm". I guess that I should comment out all -gencode ... lines except the one match my compute, specifically '-gencode arch=compute_75,code=sm_75 #rtx2080' because my machine is RTX 2080? Indeed, I have tried that, error still complains.

WorstCodeWay commented 4 years ago

Hi, @ChenYingpeng I passed that segment fault. But I really don't konw what I have done except that I rebuilt my environment on another laptop. Or may be because a cleanup CUDA stuff? Weird~

Anyway, thanks for you reply and your work! I'll close it.