Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

How to recompile darknet yolo for yolov3?

+1 vote
Hi,

I want to recompile Darknet Yolo to use the Yolov3 code. I've replaced the source in jevoisbase/Contrib/darknet with the V3 code and it looks like it's still using the old version. I also tried replacing the code in darknet-nnpack and that didn't help either. Is this the right way to go about doing this?

Also, when using jevois-daemon, where do I put the params.cfg file so I can use my custom config and weights?

Thanks
asked Jul 5 in Programmer Questions by PeterQuinn (680 points)

1 Answer

+1 vote
The code in jevoisbase/Contrib/darknet is the original unmodified code, and it is pulled there in case you want to compile it on your desktop with powerful GPUs and then use it to train a new network.

The code that runs with jevois is in jevoisbase/Contrib/darknet-nnpack

Compilation is a bit complex, have a look at the darknet section in CMakeLists.txt of jevoisbase. This is because we either use the plain scalar backend (on host) or the nnpack-accelerated one (on platform).

When using jevois-daemon on host, the modules and config files are in /jevois/
answered Jul 10 by JeVois (24,640 points)
Thanks for your help.
I got the Yolov3 tagged files from darknet-nnpack and after making a few small changes to Yolo.C it now compiles. I recompiled and put it on the device and it runs, but it still fails with my v3 config files. In order to figure this out, I recompiled on my Ubunto box so I could test it with jevois-daemon. It seg faults with my changes, which is odd because it ran on the device.
What's the best way to debug this code?
I was thinking to load it all into a debugger like codeblocks. Got any recommendations?

I'm a novice when it comes to C/C++ so there's no surprise that I've messed something up.
Yes, it took us quite some work to get V2 working as well. I am not sure how well NNPACK is integrated with V3. To debug, I would recommend to start on the host and just run

gdb --args ./jevois-daemon --videomapping=XXX

where XXX is a mapping number that will lauch YOLO (you can get it by issuing a 'listmappings' to jevois-deamon when it is running).

Then you can do the same thing on the device using a USB to serial adapter cable. See here for instructions: http://jevois.org/doc/Debugging.html

in short:

create an empty file called 'login' in the BOOT partition of your microSD. JeVois will now just get you to a login prompt over the 4-pin serial port. Username is root, no password.

then vi /usr/bin/jevois.sh and look for gdb in there; comment out the line that launches jevois-daemon and uncomment the one that launches it in gdb

then run jevois.sh which will load the kernel modules and start jevois-daemon in gdb

type run in gdb and then use inventor or guvcview, etc on your host to trigger the module. Once you crash, type 'bt' in gdb for the backtrace.
Thanks for the quick answer. It's clearly failing in the code that I changed - so that's good news. Now to figure out the mysteries of memory allocation...
...