david8862 / keras-YOLOv3-model-set

end-to-end YOLOv4/v3/v2 object detection pipeline, implemented on tf.keras with different technologies
MIT License
640 stars 222 forks source link

Large loss in yolov3 darknet finetuning #177

Closed BloomBabe closed 3 years ago

BloomBabe commented 3 years ago

Hello, I downloaded the original weights yolov3 darknet, converted them to format .h5, evalute them on coco_eval, and got good results. Then I decided to start training this model at a very low learning rate, for example, 1e-9, and as a result, I get very large values ​​of the loss function (~ 10 total). Since the model has shown good results on evalution, high values ​​of the loss function can only be associated with the calculation of losses. I have a question, what is the reason for this, is it possible to fix it somehow, or if not, are there other tensorflow repositories where the original model shows the original low values ​​of the loss function for yolov3 darknet?

david8862 commented 3 years ago

Hi @BloomBabe, loss value in this repo is sum up for all the pos/neg anchors in each sample, but not divided by the anchor number. So usually "~10 total" could be a reasonable value for well trained model here.

BloomBabe commented 3 years ago

Hi @BloomBabe, loss value in this repo is sum up for all the pos/neg anchors in each sample, but not divided by the anchor number. So usually "~10 total" could be a reasonable value for well trained model here.

So, I can add division by number of anchors to loss functions and finetune original yolov3 model? That is need for me to realise pruning and quantize aware finetuning. Thank you.

david8862 commented 3 years ago

Hi @BloomBabe, loss value in this repo is sum up for all the pos/neg anchors in each sample, but not divided by the anchor number. So usually "~10 total" could be a reasonable value for well trained model here.

So, I can add division by number of anchors to loss functions and finetune original yolov3 model? That is need for me to realise pruning and quantize aware finetuning. Thank you.

Yes, sure