pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.75k stars 21.33k forks source link

unsatisfiable condition in the new loss function #601

Open experiencor opened 6 years ago

experiencor commented 6 years ago

In the config file of YOLOv3 (https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg), the truth_threshold is set to 1. This parameter is used in a conditional statement in the new loss function to compare with best_iou, which is ALWAYS no greater than 1.

https://github.com/pjreddie/darknet/blob/259be3217b0331d07c8c5c1995d90ab9f3b768c1/src/yolo_layer.c#L182

This condition will never be satisfied. Am I wrong? @pjreddie

ahsan856jalal commented 6 years ago

Isn't it the reason why we are getting less counts and eventually when count becomes zero, we gat NaNs displayed on the terminal

pjreddie commented 6 years ago

truth_thresh doesn't have to be set to 1, you could change it to whatever you want! But i never got very good results with trying to use it. I left in thruth_thresh so i could keep playing around with it to see if I could get it to work better, it is something other people use with good results. but yeah, if you don't change the cfg that check will never be true.

experiencor commented 6 years ago

Thanks, @pjreddie!

I have another question regarding warming up training. It's in region_layer.c, but no longer there in yolo_layer.c.

https://github.com/pjreddie/darknet/blob/259be3217b0331d07c8c5c1995d90ab9f3b768c1/src/region_layer.c#L254

You also find this not helpful?

ghost commented 6 years ago

in iou_loss, label of positive anchor is 1, not overlaps like yolo2? thanks!

AshleyRoth commented 6 years ago

@pjreddie Hi! Can you help me please? i want to send my detection results through http, how i can do it?