AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.67k stars 7.96k forks source link

Darknet training script doesn't find setup files #7183

Open ghost opened 3 years ago

ghost commented 3 years ago

I followed the tutorial step by step on how to train YOLOv4 on custom data (where files should be put and what data should be provided). There were some conflicts such as :

Anyway, I tried running the script (./darknet detector train ...) without changing anything and the script couldn't find train.txt and test.txt files (which wasn't a surprise). I tried changing around the paths to fit accordingly but my it still doesn't find my setup files.

Learning Rate: 0.001, Momentum: 0.949, Decay: 0.0005
 Detection layer: 139 - type = 28 
 Detection layer: 150 - type = 28 
 Detection layer: 161 - type = 28 
Couldn't open file: data/train.txt

I scrolled through the issues and no one seems to have had it before. So there's high chance I'm missing sth obvious. However, any help would be appreciated. Thank you.

stephanecharette commented 3 years ago

If you are on Linux, you may want to try using DarkMark to create all of the files. It is a GUI, and it sets everything up so there is no problem.

To remove any ambiguity, I always use the full absolute paths for all filenames in the config files. Note that the darknet executable doesn't have to be run from the darknet directory. Everything should be self-contained within that executable. I typically setup my projects like this:

~/darknet/cfg/...
~/darknet/darknet
...
~/nn/foo/
~/nn/foo/foo.cfg
~/nn/foo/foo.names
~/nn/foo/set_01/image_001.jpg
~/nn/foo/set_01/image_002.jpg ...etc...

Then to train:

cd ~/nn/foo/
~/darknet/darknet detector -map -dont_show train foo.data foo.cfg 2>&1 | tee --append output.log
ghost commented 3 years ago

Thank you for your answer. I am working on google colab and my dataset is already labeled. But thank you for the help on the setup !