ScaledYOLOv4 icon indicating copy to clipboard operation
ScaledYOLOv4 copied to clipboard

Not able to reproduce the result for yolov4-tiny after training on coco dataset (2017)

Open suyashhchougule opened this issue 3 years ago • 4 comments

trained on coco dataset with command ./darknet detector train cfg/coco.data cfg/yolov4-tiny.cfg used same cfg provided in repo.

build darknet from https://github.com/AlexeyAB/darknet Training was proper , noticed consistent increment in loss after 136000 iteration , so used weights generated after 130000 iteration.

result I got. Screenshot from 2021-10-03 00-24-33

expected result is as mentioned in repo

suyashhchougule avatar Oct 05 '21 12:10 suyashhchougule

Do you follow the training instruction as shown in https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-tiny#training?

WongKinYiu avatar Oct 05 '21 12:10 WongKinYiu

Do you follow the training instruction as shown in https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-tiny#training?

yes I have added the details , please check

suyashhchougule avatar Oct 05 '21 13:10 suyashhchougule

the training need max_batches = 2000200 and the learning rate will change at steps=1600000,1800000 this means accuracy will suddenly upgrade twice at after 1600000 and 1800000 iteration respectively. empirically the best model will be at 1800000~2000200 iteration. while you only train 136000 iterations, which is less than 10 times iterations than needed. you definitely can not reproduce the results with this setting. if you want to get results quickly, you could divide max_batches and steps by ten to get 16~20 AP.

WongKinYiu avatar Oct 05 '21 13:10 WongKinYiu

but as per https://github.com/AlexeyAB/darknet#:~:text=change%20line%20max_batches%20to%20(classes*2000%2C%20but%20not%20less%20than%20number%20of%20training%20images%20and%20not%20less%20than%206000)%2C%20f.e.%20max_batches%3D6000%20if%20you%20train%20for%203%20classes max_batches = classes * 2000 which is in this case 80*2000 = 160000 , right ? or is it because for custom training we start training using partial trained weights instead of starting from scratch ?

suyashhchougule avatar Oct 05 '21 15:10 suyashhchougule