Darknet: Segmentation Fault (Core Dumped) running test commad.

Created on 16 Oct 2018  路  12Comments  路  Source: AlexeyAB/darknet

@AlexeyAB
I can successfully run train, valid, recall, map commands, but I failed on test command on my own grayscale dataset.

Once the detector detects objects and shows some possibilities, then it just ended with Segmentation Fault. However, if the detector detects nothing on my image, then it ends peacefully.

I do not know why that happens and do not know how to fix it.
Could you please help me out?
Thanks in advance.

Bug fixed

All 12 comments

@yz3007

  • Can you attach your cfg-file and image-file to your message (drag-n-drop here).

  • Can you run successfully ./darknet detector demo ... test.mp4 ?

@AlexeyAB
I can run the command successfully ./darknet detector demo ../Desktop/darknet/cfg/coco.data ../Desktop/darknet/cfg/yolov3.cfg ../Desktop/darknet/yolov3.weights ../Desktop/test.mp4 -out_filename res.avi

I have attached the cfg-file and sample gray-scale image below.

20181012-083311-0513_1

yolov3-obj.cfg.txt

@AlexeyAB
I also attached the result of ./darknet detector test build/darknet/x64/data/obj.data build/darknet/x64/cfg/yolov3-obj-test.cfg build/darknet/x64/backup/yolov3-obj_1000.weights build/darknet/x64/data/obj/wxivision/20181012/NG/20181012-083348-0500_1.jpg
screenshot from 2018-10-17 08-47-13

@yz3007

  • Do you use the latest version of code from this repository?
  • Can you share (for example by using Google disk) your yolov3-obj_1000.weights file?

@AlexeyAB
I just gitted clone your repository on 10/15. I started trainning on 10/16. (Today I will retrain my model and try to see any good outcoming.)

It contains my training weight.
https://drive.google.com/file/d/1kv5BG1jPKl8fZk82r4YOEB_NS2veNIJh/view?usp=sharing

@AlexeyAB
Hi bro,
I actually use darknet53.conv.74 as the starting point to train my gray-scale image.
I guess darknet53.conv.74 is based on RGB(channel =3) by default, but I apply it on gary-scale(channels =1).

shouldn't I run ./darknet detector train data/obj.names cfg/XXX.cfg from scratch without any weightfile instead of running ./darknet detector train data/obj.names cfg/XXX.cfg

Is that reason why my test command collapsed?

Any comments?

Updated:
Even if I use the weights trained from scratch, it still crashed after making prediction before displaying the labeled picture(prediction.jpg)

@yz3007

  • You should train 1-channel model without pre-trained weights.

  • Can you shouw your obj.data and obj.names files?

  • I just run this command - and it works successfully without any detection:
    darknet.exe detector test data/coco.data yolov3-obj.cfg yolov3-obj_1000.weights bw.jpg

image

@AlexeyAB
Right now, I have trained my model without any pretrained weights. But after 200 batches, I run test it failed because it crashed when it finds some objects and tries to label it on the image.

It does works fine if it does not find anything. But it will crash once it finds anything..... Sometimes I set -thresh 0.1 to run the command in order to find some objects, then it failed. I will send all my stuffs within hours includes some image files even in here or google disk.

Thanks for your sincere replies.

@yz3007

I fixed it.
Try to update your code from GitHub.

And you should train more than 4000 iterations to get good detections.

@AlexeyAB
Thanks god. You save my life!
Thanks for your suggestion.

@AlexeyAB
Hi bro,
It works now. I can see the detected label on the image.

probelm1:

however, I do not see the rectangle mark on the image. Also, sometimes the label character will cover the detected image. It is different from labeld iamge in RGB format(it shows some rectangles and the label is alongside the edge of rectangle)
You can see attached three images. One is original, another one is marked which saved automatically as prediction.jpg, last one which is opened directly by opencv and saved as screenshot.

Especially the last of two prediction images have different labeled behaviors by human eyes around detected objects.

I do not know why they are not keep consistent and behave slighly differently, although they are supposed to be same.

probelm 2:

It looks like it will only label two marks even if I set low threshold and it print out three objects find inthe terminal.

for example:
defect: 39%
defect: 13%
defect: 42%

However, I believe the image is only labeld top two of them and omit the 13% one.

probelm 3:

Is there any way I can get the label coordinates(the center(x,y), width, height )? then I can label it by myself in other tool. If possible, could you please point it out to me.

Thanks in advance.

20181012-083311-0513_1
predictions
predictions_screenshot_18 10 2018

Update your code from GitHub again
and then change this line: https://github.com/AlexeyAB/darknet/blob/bdbbb2fd6995306de09c003fd16e4e5502d73804/src/image.c#L386
to this:
draw_box_width_bw(im, left, top, right, bot, 1, 0.8); // 1 channel Black-White

then run detection with flag -ext_output

./darknet detector test data/coco.data yolov3-obj.cfg yolov3-obj_1000.weights bw.jpg -ext_output

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kebundsc picture kebundsc  路  3Comments

qianyunw picture qianyunw  路  3Comments

yongcong1415 picture yongcong1415  路  3Comments

zihaozhang9 picture zihaozhang9  路  3Comments

HanSeYeong picture HanSeYeong  路  3Comments