Darknet: Error - cutsom object detection

Created on 6 Oct 2017  ·  4Comments  ·  Source: pjreddie/darknet

Using the GPU =1 and CUDNN = 1 version (no opencv)
Detection works correctly, upon compiling the project. But when I try to train on my own dataset, a bunch of errors pop up!
Attempting to train the model with custom data
Steps followed -

  1. All image files and txt files in data/obj
  2. obj.data and obj.names in data/
  3. train.txt, yolo-obj2.cfg(modified as in attached file), and downloaded pretrained (weights( [] https://pjreddie.com/media/files/darknet19_448.conv.23 ))
    When I run the following from the terminal,
    ./darknet detector train data/obj.data yolo-obj2.cfg darknet19_448.conv.23

I get the below error:

yolo-obj2
First section must be [net] or [network]: No such file or directory
darknet: ./src/utils.c:224: error: Assertion ``0' failed.
Aborted

I have modified the config file. I have attached the same. I have 2 classes. So the following changes have been made
classes = 2
filters = 35
yolo-obj2.zip

What am I missing? How do I fix this?

Most helpful comment

find . -type f -name "*.txt" -print0 | xargs -0 dos2unix

Run this in you linux machine. change '.txt' to '.data', '.cfg' and '.names'.

linux and windows use diff encoding

All 4 comments

I have exactly the same issue. Do you have any solution to this ?

Basically there was an encoding problem of sorts, because I was sending the config files over ssh from a windows machine to linux. So, I had to download the config files on the linux machine and edit them instead of editing on windows and sending it. If that's the case for you as well, you could do this.

find . -type f -name "*.txt" -print0 | xargs -0 dos2unix

Run this in you linux machine. change '.txt' to '.data', '.cfg' and '.names'.

linux and windows use diff encoding

YOLOV3-TINY CASE. If your objects are small and you decide to change the upsample, then DO NOT FORGET about the route layer after yolo layer. 2 values ​​from the layer field mean layers which outputs will be concatenated. One of these layers is hard coded, but with a change in the upsample, it begins to diverge from that which is relative. When building a model you see a table, and you need to select layers with the same outputs and specify their numbers in the route layer (in my case, -1 and 6). I’m requesting to add this in readme explicitly for yolov3-tiny case (and explain that shortly), because I spent 2 days (literally, I didn’t sleep at night) to solve this error, so I cannot describe the solution in a human way at the moment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gpsmit picture gpsmit  ·  3Comments

TheHidden1 picture TheHidden1  ·  3Comments

ivomarvan picture ivomarvan  ·  3Comments

ghost picture ghost  ·  4Comments

spaul13 picture spaul13  ·  3Comments