Darknet: Segmentation fault (core dumped)

Created on 16 Dec 2018  Â·  7Comments  Â·  Source: pjreddie/darknet

When I try to use the command line,then i got this error.Training and test were fine but in this i got an error .

./darknet detector valid data/obj.data yolov2.cfg yolov2_30000.weights result.txt
results: Using default 'results'
layer filters size input output
0 conv 32 3 x 3 / 1 608 x 608 x 3 -> 608 x 608 x 32 0.639 BFLOPs
1 max 2 x 2 / 2 608 x 608 x 32 -> 304 x 304 x 32
2 conv 64 3 x 3 / 1 304 x 304 x 32 -> 304 x 304 x 64 3.407 BFLOPs
3 max 2 x 2 / 2 304 x 304 x 64 -> 152 x 152 x 64
4 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128 3.407 BFLOPs
5 conv 64 1 x 1 / 1 152 x 152 x 128 -> 152 x 152 x 64 0.379 BFLOPs
6 conv 128 3 x 3 / 1 152 x 152 x 64 -> 152 x 152 x 128 3.407 BFLOPs
7 max 2 x 2 / 2 152 x 152 x 128 -> 76 x 76 x 128
8 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BFLOPs
9 conv 128 1 x 1 / 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BFLOPs
10 conv 256 3 x 3 / 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BFLOPs
11 max 2 x 2 / 2 76 x 76 x 256 -> 38 x 38 x 256
12 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BFLOPs
13 conv 256 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BFLOPs
14 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BFLOPs
15 conv 256 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BFLOPs
16 conv 512 3 x 3 / 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BFLOPs
17 max 2 x 2 / 2 38 x 38 x 512 -> 19 x 19 x 512
18 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BFLOPs
19 conv 512 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BFLOPs
20 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BFLOPs
21 conv 512 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BFLOPs
22 conv 1024 3 x 3 / 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BFLOPs
23 conv 1024 3 x 3 / 1 19 x 19 x1024 -> 19 x 19 x1024 6.814 BFLOPs
24 conv 1024 3 x 3 / 1 19 x 19 x1024 -> 19 x 19 x1024 6.814 BFLOPs
25 route 16
26 conv 64 1 x 1 / 1 38 x 38 x 512 -> 38 x 38 x 64 0.095 BFLOPs
27 reorg / 2 38 x 38 x 64 -> 19 x 19 x 256
28 route 27 24
29 conv 1024 3 x 3 / 1 19 x 19 x1280 -> 19 x 19 x1024 8.517 BFLOPs
30 conv 30 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 30 0.022 BFLOPs
31 detection
mask_scale: Using default '1.000000'
Loading weights from yolov2_30000.weights...Done!
Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005
eval: Using default 'voc'
4
Segmentation fault (core dumped)

Why did i get this error ? how can i solve that

Most helpful comment

@srhtyldz probably you missed the results folder, just create the folder name "results" and run again. It will be solved.

All 7 comments

I didn't trace the exact reason. However, it looks like it depends on the input image (I tested it on the dog picture and it worked; on my own pictures I got segmentation faults). It seems like I can build stable versions of darknet on Ubuntu LTS (16.04, 18.04) versions but not any newer system (e.g. Fedora, openSUSE tumbleweed, ArchLinux etc.). My best guess is that there are some external libraries that do cause some harm (also current CUDA versions still do not support gcc v8.x).

In general, there are quite many bugreports on this.

If you are only interested in the model and not in darknet itself (such as me), it might be wiser to move to a TensorFlow/PyTorch/etc. implementation of it.

@srhtyldz probably you missed the results folder, just create the folder name "results" and run again. It will be solved.

@srhtyldz probably you missed the results folder, just create the folder name "results" and run again. It will be solved.

I'll try it .Thnx

Excuse me,have you solved this problem? I have met the same problem and have no idea what to do.

You can check if the coordinate of your bounding box contains any 0.0, if so change it to a very small value

I know it's an old issue but for me it looks like it isn't reading my .data file for whatever reason, so it's using a default of 20 classes, instead of mine which has 4, which is causing the segfault when identifying

One of the dumbest things occurred, when opening the .cfg file to change the number of subdivisions I accidentally tiped "/" in the beginning of the file. Resulting in:
/[net]
This meant the .cfg was not being read.

Please make sure to double check when working on th terminal because errors like these occur often and are very time consuming.

Was this page helpful?
0 / 5 - 0 ratings