YOLO-Face-detection icon indicating copy to clipboard operation
YOLO-Face-detection copied to clipboard

Segmentation fault

Open iqbalnaved opened this issue 7 years ago • 10 comments

Hi,

I tried to do detect faces from a specific image using your model using the following command:

esb172@esb172-Alienware:/media/esb172/darknet$ ./darknet detect cfg/yolo-face.cfg models/yolo-face_final.weights /media/esb172/lfw/Aaron_Eckhart/Aaron_Eckhart_0001.jpg

But I am getting segmentation fault error everytime. The output is given below:

layer     filters    size              input                output
    0 Crop Layer: 448 x 448 -> 448 x 448 x 3 image
shift: Using default '0.000000'
    1 conv     16  3 x 3 / 1   448 x 448 x   3   ->   448 x 448 x  16
    2 max          2 x 2 / 2   448 x 448 x  16   ->   224 x 224 x  16
    3 conv     32  3 x 3 / 1   224 x 224 x  16   ->   224 x 224 x  32
    4 max          2 x 2 / 2   224 x 224 x  32   ->   112 x 112 x  32
    5 conv     64  3 x 3 / 1   112 x 112 x  32   ->   112 x 112 x  64
    6 max          2 x 2 / 2   112 x 112 x  64   ->    56 x  56 x  64
    7 conv    128  3 x 3 / 1    56 x  56 x  64   ->    56 x  56 x 128
    8 max          2 x 2 / 2    56 x  56 x 128   ->    28 x  28 x 128
    9 conv    256  3 x 3 / 1    28 x  28 x 128   ->    28 x  28 x 256
   10 max          2 x 2 / 2    28 x  28 x 256   ->    14 x  14 x 256
   11 conv    512  3 x 3 / 1    14 x  14 x 256   ->    14 x  14 x 512
   12 max          2 x 2 / 2    14 x  14 x 512   ->     7 x   7 x 512
   13 conv   1024  3 x 3 / 1     7 x   7 x 512   ->     7 x   7 x1024
   14 conv   1024  3 x 3 / 1     7 x   7 x1024   ->     7 x   7 x1024
   15 conv   1024  3 x 3 / 1     7 x   7 x1024   ->     7 x   7 x1024
   16 connected                            50176  ->   256
   17 connected                             256  ->  4096
   18 dropout       p = 0.50               4096  ->  4096
   19 connected                            4096  ->  1331
   20 Detection Layer
forced: Using default '0'
Loading weights from models/yolo-face_final.weights...Done!
/media/esb172/4TBSSHD/Naved/LFW_experiment/lfw/Aaron_Eckhart/Aaron_Eckhart_0001.jpg: Predicted in 0.296059 seconds.
Segmentation fault (core dumped)

Could you please help on fixing this issue?

Thanks in advance.

iqbalnaved avatar Jun 07 '17 22:06 iqbalnaved

What is the memory size of your NVIDIA card?

dannyblueliu avatar Jun 08 '17 02:06 dannyblueliu

Hi Danny, thanks for replying. I am running on a machine with 3 TitanX pascal cards. But someone else is using gpu 0. So, I should change the gpu device to an idle one. Could you please just show me where in the code I can do that, that'll save me some time. Thanks again!

iqbalnaved avatar Jun 08 '17 03:06 iqbalnaved

Hi Danny,

I have tried adding '-gpus 0,1' to the command. Still same problem. Btw TitanX pascal's have 12GB memory. Please advise.

Thanks.

iqbalnaved avatar Jun 08 '17 17:06 iqbalnaved

try to put opencv=0 in Makefile

dannyblueliu avatar Sep 13 '17 02:09 dannyblueliu

do you have any solution ? i also got that problem when i try to detect with specific image

back-kh avatar Nov 20 '17 00:11 back-kh

@dannyblueliu I set opencv=0 and was recompiled code but still have a Segmentation fault.

kharazi avatar Nov 28 '17 15:11 kharazi

I'd be curious if your image size is large, you may want to scale the image to something like 640 x 480, and see if it still segfaults. We see this all the time in py-yolo.

cxplanet avatar Nov 29 '17 23:11 cxplanet

In line 322, src/yolo.c, change the number 20 to 1. It may work.

wukgdu avatar Nov 30 '17 11:11 wukgdu

@wukgdu is right. This code assumes 20 classes of the original network.

avlaskin avatar Jan 29 '18 04:01 avlaskin

I don't have such problem. Thanks for the help bro. @wukgdu

dannyblueliu avatar Jan 29 '18 04:01 dannyblueliu