简体   繁体   中英

Yolo not starting to train

I am trying to train Yolo on a custom dataset and everything seems to be working without errors but it just isn't training.

I followed the tutorial on https://github.com/AlexeyAB/dar.net twice but I get the same results

./darknet detector train data/obj.data cfg/yolo-obj.cfg yolov4.conv.137

[yolo] params: iou loss: ciou (4), iou_norm: 0.07, cls_norm: 1.00, scale_x_y: 1.05
nms_kind: greedynms (1), beta = 0.600000 
Total BFLOPS 59.563 
avg_outputs = 489778 
Loading weights from yolov4.conv.137...
 seen 64, trained: 0 K-images (0 Kilo-batches_64) 
Done! Loaded 137 layers from weights-file 
Learning Rate: 0.001, Momentum: 0.949, Decay: 0.0005
Resizing, random_coef = 1.40 

 608 x 608 
 Create 64 permanent cpu-threads 

 mosaic=1 - compile Darknet with OpenCV for using mosaic=1 

I also tried without the pre-trained weights but this doesn't start the training process either

./darknet detector train data/obj.data cfg/yolo-obj.cfg
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, cls_norm: 1.00, scale_x_y: 1.05
nms_kind: greedynms (1), beta = 0.600000 
Total BFLOPS 59.563 
avg_outputs = 489778 
Learning Rate: 0.001, Momentum: 0.949, Decay: 0.0005
Resizing, random_coef = 1.40 

 608 x 608 
 Create 64 permanent cpu-threads 

 mosaic=1 - compile Darknet with OpenCV for using mosaic=1 

What am I missing?

If you want to use OpenCV you need to re-compile Dar.net, but first change the make file to the following:

 OPENCV=1

If you don't need OpenCV then do as @TaQuangTu sugested. When you fix this line just run the build.sh script again and it should work just fine.

I'd also suggest changing the following lines if you intent to train using a GPU

GPU=1
CUDNN=1
CUDNN_HALF=1 

my friend, l just solved this problem right now. l think i have find the reason here. If your train/test.txt are empty, this is the rreason. you open"creating-train-and-test-txt-files.py" and edit it. Find the keyword is jpeg place. we could find only 2 jpeg words here and you edit them into "jpg" and replace this in your Google Drive. Finally, restart the colaboratory work. And your training will not quit for "608 x 608 Create 64 permanent cpu-threads ".

Best wishes from China.

The above error is caused mainly due to empty train.txt and test.txt files. Please check these two files

How have you installed OpenCV?

For a simple fix, you can try this sudo apt install libopencv-dev python3-opencv

Also make sure you have cmake,

sudo apt install cmake

This should install opencv 3.2 and cmake 3.10 in your system. Then try running dar.net.

Finally, change the Makefile,

OPENCV=1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM