I went into segmentation violation while running detection.
then I located it happened in following line:
network_predict_ptr(n, sized.data);
in line 17, network.c
I simply switch it to network_predict_image(n, sized);
and it works fine
here's the segmentation error that I got before the change
`fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x7f87d443c000 pc=0x7f8a45518d8f]
runtime stack:
runtime.throw(0x53d64e, 0x2a)
/usr/local/go/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:679 +0x46a
goroutine 1 [syscall]:
runtime.cgocall(0x4f04f0, 0xc00006dbc0, 0xc00007a028)
/usr/local/go/src/runtime/cgocall.go:133 +0x5b fp=0xc00006db90 sp=0xc00006db58 pc=0x405b3b
github.com/LdDl/go-darknet._Cfunc_perform_network_detect(0x116e1f0, 0xc00007a028, 0x3e80000000000001, 0x3ee666663f000000, 0x0, 0x0, 0x0)
_cgo_gotypes.go:869 +0x4d fp=0xc00006dbc0 sp=0xc00006db90 pc=0x4cd2dd
github.com/LdDl/go-darknet.(*YOLONetwork).Detect.func1(0xc00006de78, 0xc00007a000, 0x0, 0x0)
/home/idx/go/src/github.com/LdDl/go-darknet/network.go:72 +0x117 fp=0xc00006dc30 sp=0xc00006dbc0 pc=0x4cf5b7
github.com/LdDl/go-darknet.(*YOLONetwork).Detect(0xc00006de78, 0xc00007a000, 0xc00007a000, 0x0, 0x0)
/home/idx/go/src/github.com/LdDl/go-darknet/network.go:72 +0x8e fp=0xc00006dd40 sp=0xc00006dc30 pc=0x4cec1e
main.main()
/home/idx/go/src/github.com/LdDl/go-darknet/example/main.go:66 +0x339 fp=0xc00006df88 sp=0xc00006dd40 pc=0x4ef9a9
runtime.main()
/usr/local/go/src/runtime/proc.go:203 +0x1fa fp=0xc00006dfe0 sp=0xc00006df88 pc=0x4353ea
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc00006dfe8 sp=0xc00006dfe0 pc=0x45fb71
exit status 2`