Yolov2 darknet training with custom dataset for jetson tx2


I am trying to train my own dataset with yolo and I created weight file with 800 iteration, but I tried to “./darknet detector demo …” command I took an error like Segmentation fault(core dump). Could you please help me?
I have one class;
I used convolution layers for weights “darknet19_448.conv.23”
I used as a .cfg file that is created to copy tiny-yolo-voc-2.0.cfg. I changed classes= 20 to classes= 1, I changed filter= 125 to filter=30.
I created training process with respect to below links;
(How to train (to detect your custom objects))


Start from the beginning. Try reproducing the original training. Can you do that without crashing?

Separately, I’m not sure “1 class” makes too much sense. For a “yes or no” question, I’d probably use two classes. It may be that the code doesn’t work well with a single class (might make some math go off the rails, for example) – you’d have to read the source code to know for sure.

Finally, I’m assuming you compiled Darknet from source, so you should be able to start it with gdb, and get a stack trace when it crashes, and use the debugger to figure out what’s going wrong in your example, so you can fix it.


Do you want to use TX2 for training?
We recommend user to do training with a desktop GPU and apply inference on Jetson.

If you want to train your model on TX2, please check this page for YOLO setting:

After that, check if you can detect and train with the default darknet and then test the custom use-case.
Here are lots of darknet user. Try to share more information to get the suggestions.


Hi thank you for answers

Dear Snarky

First I will try standart training procedure with original training instructions and VOC dataset, after if it works I will try to train with more then one class, but I don’t understand part of the beginning with ‘Finally… gdb?..debugger?’ because I don’t use debugger, gdb or something and I am not expert about this. Could you please explain that sentence with detail?

Dear AastaLLL

I used that link already to install yolo and I tried demo with tiny-yolo-demo real-time. I dont see any problem, original pre-trained system is working but this link has any information about training with custom dataset. I used for training links above, also I dont have GPU device for now, I will use CPU device for training and I will tray again.

If you do not know how to do C/C++ development, and are running into a segmentation fault crash in some software, then you need to find someone who does know C/C++ development. You might be able to ask in the Darknet support channels, for example.


We still recommend user to have an x86-based GPU for training.
Maybe you can check the cloud-based GPU service if it’s not acceptable to have a real one.

We have a tutorial to teach a user to train their custom model on DIGITs.
For your reference: https://github.com/dusty-nv/jetson-inference#locating-object-coordinates-using-detectnet


I’m working on running yolo on Tx2 Dev kit. I have installed all of requirements for yolo, OpenCV, CUDA, Cudnn.
I’ve tested if the onboard camera’s working via gstreamer : gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! xvimagesink
It works properly.
Then, I tried to run yolo by your code ./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights “nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720,format=(string)I420, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink”
The result is “Video-stream stopped!”
How could i track the issue?