Segmentation fault in cpu mode.
I have successfully train the rfcn model and test in gpu model. But when i run the demo in cpu model the program will core dump with "Segmentation fault". Can anyone help me about this problem?
the gdb error info is:
#0 0x00007ffff6e44653 in __memcpy_ssse3_back () from /usr/lib64/libc.so.6
#1 0x00007fffe368c848 in caffe::ScaleLayer
I also met with segmentation fault in cpu mode when running demo_rfcn. Have you resolved this issue?
@moting9 I find that the psroi_pooling_layer doesn't implement in CPU.
@misery0424 Did you run with flag --cpu ?
I run into the same issue, with the following command: demo_rfcn --net ResNet-50 --cpu
Hi @misery0424 , It might dut to the fact that we didn't implement forward_cpu of psroipooling. Maybe we can implement it yourself, or only use gpu mode.
Do you implement the CPU mode, or can you tell me what should I do if I want to implement the CPU mode, Thanks
@misery0424 @moting9 @plopd @mlot @liyi14 Hello everyone, do you implement the cpu mode in test? If you do, please tell me, thanks!
@misery0424 @moting9 @plopd @mlot @liyi14 did a quick CPU implementation by stealing code from its GPU counterpart: https://github.com/caiyang/caffe-rfcn
@caiyang I just tried your psroi_pooling_layer, it didn't work and shows "segmentation fault". I used py-r-fcn, what I did is replace your psroi_pooling_leyer.cpp and add file rfcn_layers.hpp. After that, I re-compiled my py-r-fcn, but it didn't work.
@xuxuzhou I believe the problem is a bug in the caffe-ms the py-R-FCN uses. If you remove all layers except for the first conv-bn-scale block and run the demo in cpu mode again, the segmentation fault still exists. The segmentation fault is caused by the Forward_cpu in scale_layer.cpp: caffe_copy(bottom[0]->count(), bottom[0]->cpu_data(), temp_.mutable_cpu_data());
the memory copy source and destination sizes are different(i.e. bottom[0]->count() != temp_.count()), this is because your actual input size is different from the size defined in the deploy.prototxt.
You can change the code as follow (as scale_layer.cu did), and recompile caffe, the problem should disappear:
const bool scale_param = (bottom.size() == 1); if (!scale_param || (scale_param && this->param_propagate_down_[0])) { caffe_copy(bottom[0]->count(), bottom[0]->cpu_data(), temp_.mutable_cpu_data()); }
@caiyang you are right. good job!mark
@caiyang Hello.I have tried your solution to run r-fcn on cpu mode. It worked, make&make pycaffe&make test all passed successfully. However, when ./tools/demo_rfcn.py --net ResNet-50 --cpu , it shows time every picture used but shows no pictures. While I save the pictures, they are totally white with nothing.
Have you ever seen such a situation? I would appreciate if you can help me.