longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.55k stars 420 forks source link

Question about it loss weight #69

Closed xuzijian closed 6 years ago

xuzijian commented 6 years ago

Hi,

I've checked the training code today and found training loss is the sum of objectness loss with multi-class classification loss and bbox regression loss. I have checked the code written by author who claim loss weight as: (maybe I'm wrong since I'm really not familiar with Darknet framework) https://github.com/pjreddie/darknet/blob/d3828827e70b293a3045a1eb80bfb4026095b87b/cfg/yolov2.cfg#L251 , which is used in https://github.com/pjreddie/darknet/blob/d3828827e70b293a3045a1eb80bfb4026095b87b/src/detection_layer.c#L164 My points is:

  1. do we need to adopt different weight for different loss?
  2. maybe loss for object classification is not MSE but cross-entropy loss? (as far as i know, yolo v3 adopts binary logistic regression for multi-class classification)

Thanks in advance and look forward to seeing your help!

xuzijian commented 6 years ago

I found the implementation of noobject_scale in the code. Just close it and sorry for inconvenience.