AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.65k stars 7.96k forks source link

dets[j].prob[i] > 0 Null pointer access exception #6322

Open benkelaci opened 4 years ago

benkelaci commented 4 years ago

Hi @AlexeyAB,

I am using the darknet.py and it seem this part indexing was changed, but I am not able to figure it out how: https://github.com/AlexeyAB/darknet/blob/master/darknet.py#L296

I am getting this exception at that line: NULL pointer access

I am using this commit: fe4b2d008e7aa168e031400e531d4b462ee9d326 Can you tell me what could be the problem?

Thank you.

eliottsegard commented 4 years ago

I have the exact same problem, the second detection in dets (j = 1) doesn't seem to have a 'prob' (the first one works fine).

this guy seems to have the same problem: https://github.com/AlexeyAB/darknet/issues/6324#issue-664561290

versavel commented 4 years ago

I'm also experiencing the same segmentation fault and can confirm the exception is triggered by https://github.com/AlexeyAB/darknet/blob/master/darknet.py#L296

I don't have the issue when I use a Jetson Xavier AGX developer kit, with JetPack 4.3 and commit 6c6f04a (June 6, 2020)

The issue pops up when I change just one of the following:

AlexeyAB commented 4 years ago
versavel commented 4 years ago

Thank you @AlexeyAB ! Updating the class DETECTION(Structure): class definition in my customized darknet.py file fixed the issue on my Jetson Nano with Jetpack 4.4.

benkelaci commented 4 years ago

@AlexeyAB : thanks for the guidance. I think now I can fix this. Do you know what is the default value for the hier_thres and nms? If I use the ./darknet ... executable, then I am getting a little bit different results as with this python solution. I setup the same threshold for both, but I am not sure about the hier_thresh and the nms. Is nms same as in the .cfg: beta_nms?

ahmettarhan commented 3 years ago

@AlexeyAB I have changed the DETECTION class and recompiled libdarknet.so but I am still getting the same error. As @eliottsegard mentioned the problem is in the second detection in dets (i.e. when it's comes to the dets[1].prob[2] python crashes). I am using NVIDIA Jetson AGX Xavier wtih Jetpack 4.5.1, CUDA version 10.2.89, and OpenCV 4.1.1. I am running the code given in https://github.com/stereolabs/zed-yolo/tree/master/zed_python_sample. How can I fix the problem? Please help.

By the way I am successfully running ./uselib data/coco.names cfg/yolov4.cfg yolov4.weights zed_camera script in darknet home folder without any error. The problem is with python script