AlexeyAB / darknet

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

Getting 'inf' and '0' values in .txt file while running pseudo labelling command. What is the possible issue and solution for this? #8171

Open priyankajain03 opened 3 years ago

priyankajain03 commented 3 years ago

Below is the image that i ran the code on and its corresponding generated .txt file. I am using tiny yolov4 weights. I am using this command - darknet.exe detector test cfg/coco.data cfg/yolov4-tiny-custom.cfg yolov4-tiny.weights -thresh 0.25 -dont_show -save_labels < data/new_train.txt

frame_1 frame_1.txt

stephanecharette commented 3 years ago

As discussed on Discord, this is working for me. When I run this command:

./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -thresh 0.25 -dont_show -save_labels < test.txt

...the .txt file that it creates for the image above has the following content:

32 0.9619 0.5431 0.0077 0.0193
0 0.1005 0.5337 0.0439 0.3087
0 0.7983 0.5946 0.1234 0.7953
0 0.3879 0.6230 0.1698 0.7101
0 0.2780 0.6253 0.1264 0.6971
0 0.4552 0.5311 0.0457 0.3405
0 0.6128 0.4971 0.0309 0.1890
0 0.1334 0.5215 0.0456 0.3276
0 0.0490 0.4801 0.0259 0.1202
0 0.6427 0.4826 0.0203 0.1377
0 0.9221 0.4702 0.0186 0.1010
0 0.7183 0.4581 0.0150 0.0764
0 0.8921 0.4825 0.0138 0.0884
0 0.5341 0.4702 0.0162 0.0931
0 0.8638 0.4576 0.0138 0.0683
0 0.5179 0.4707 0.0233 0.0927
0 0.6606 0.4637 0.0123 0.0661
0 0.8388 0.4813 0.0189 0.1438

If I had to guess, I'd say you have some corrupted .weights files, or your build of darknet is somehow bad.

stephanecharette commented 3 years ago

We figured out the problem on Discord. The weights file they were using was yolov4-tiny.conv.29, not the correct weights file. And the .cfg file had been incorrectly modified because they only wanted a subset of the MSCOCO classes.