sowson/darknet

yolov4 prediction crashes on mac

bogdad opened this issue · 4 comments

hey,
thank you for opencl version, this seems very cool to have!

i am getting this crash on mac big sour, trying to run yolo4, regular one or tiny.

(lldb) target create "./darknet"
Current executable set to '/Users/vladimir/workspace/darknet/darknet' (x86_64).
(lldb) settings set -- target.run-args  "-i" "1" "yolo4" "test" "cfg/yolov4-tiny.cfg" "yolov4-tiny.weights" "1.png"
(lldb) run
Process 61001 launched: '/Users/vladimir/workspace/darknet/darknet' (x86_64)
Device IDs: 2
Device ID: 1
Device name: AMD Radeon Pro 560X Compute Engine
Device vendor: AMD
Device opencl availability: OpenCL 1.2
Device opencl used: 1.2 (May  8 2021 06:19:33)
Device double precision: YES
Device max group size: 256
Device address bits: 32
layer     filters    size              input                output
    0 conv     32  3 x 3 / 2   416 x 416 x   3   ->   208 x 208 x  32  0.075 BFLOPs
    1 conv     64  3 x 3 / 2   208 x 208 x  32   ->   104 x 104 x  64  0.399 BFLOPs
    2 conv     64  3 x 3 / 1   104 x 104 x  64   ->   104 x 104 x  64  0.797 BFLOPs
...
[yolo4] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.05
nms_kind: greedynms (1), beta = 0.600000
Loading weights from yolov4-tiny.weights...done!
darknet was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 61001 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010003f89c darknet`avg_predictions(net=0x00007ffeefbf89f0, nboxes=0x00007ffeefbf91cc) at demo.c:75:45 [opt]
   72       int count = 0;
   73       fill_cpu(demo_total, 0, avg, 1);
   74       for(j = 0; j < demo_frame; ++j){
-> 75           axpy_cpu(demo_total, 1./demo_frame, predictions[j], 1, avg, 1);
   76       }
   77       for(i = 0; i < net->n; ++i){
   78           layer l = net->layers[i];
Target 0: (darknet) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010003f8cc darknet`avg_predictions(net=0x00007ffeefbf89f0, nboxes=0x00007ffeefbf91cc) at demo.c:75:45 [opt]
    frame #1: 0x00000001000b370b darknet`test_yolo4(cfgfile=<unavailable>, weightfile=<unavailable>, filename="1.png", thresh=0.200000003) at yolo.c:647:16 [opt]
    frame #2: 0x00000001000b3b8c darknet`run_yolo4(argc=<unavailable>, argv=<unavailable>) at yolo.c:687:36 [opt] [artificial]
    frame #3: 0x00000001000d075f darknet`main(argc=8, argv=0x00007ffeefbfeca0) at darknet.c:452:9 [opt]
    frame #4: 0x00007fff2065bf5d libdyld.dylib`start + 1
(

it seems predictions is 0x000000000...
tried debugging a bit and seems in pull_network_output(netp); in the

   1295 void pull_network_output(network *net)
   1296 {
   1297     layer l = get_network_output_layer(net);
-> 1298     opencl_pull_array(l.output_gpu, l.output, l.outputs*l.batch);
   1299 }

l.output and l.output_gpu are not zero. but also no pointers to what may be wrong.

can continue debugging, will appreciate hints though!

It looks like a hardware issue to me... you may change to opencl_pull_array_map (same parameters) function in line 1298, but I doubt it helps. I have just checked. Screen Shot 2021-07-11 at 02 49 08 it works!

@bogdad the command is:
./darknet detect cfg/coco.data cfg/yolov4-tiny.cfg ../weights/yolov4-tiny.weights data/dog.jpg -i 1

and in the cfg file, you should replace [yolo] with [yolo4] once I support [yolo] tag as ver. 3, ok..?

but it is an unknown issue that version v4 of Yolo works as I showed you but tiny does... not... yet!

let me add my 2 cents... error is in the clBLAS and/or in CLBlast for GEMM computing... maybe I should find some other project that multiplies matrixes? I am not sure... anyway, appreciate your try to find the issues ;-). thanks!

you are trying to use yolo4-tiny that did not work.. till now :).
predictions