ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.34k stars 16.25k forks source link

box_loss, obj_loss, and cls_loss #5052

Closed karl-gardner closed 3 years ago

karl-gardner commented 3 years ago

Hello Glenn et al.,

I am wondering what all the different losses mean in the results figure and where I can learn more about this? If you can give the equations for these losses that would be great. Specifically the box, obj, and cls loss? Is the box loss referring to the Generalized IOU loss (GIOU).

results

Thanks,

Karl Gardner | Texas Tech University

glenn-jocher commented 3 years ago

@kgardner330 box loss is the regression loss for output xywh bounding boxes. Loss criteria in use is CIoU(). You can see details in loss.py: https://github.com/ultralytics/yolov5/blob/5afc9c25ef0874dff0c18267947ea4e8b03c90f4/utils/loss.py#L131-L137

For a general description of the YOLO losses you should read the first 3 YOLO papers: https://pjreddie.com/publications/

gepaohhh commented 1 year ago

Hello Glenn et al., I am wonder why there is nothing in my graphics, weather is something wrong in my CUDA version image

glenn-jocher commented 1 year ago

@gepaohhh you are showing mAP so you do have validation data, not sure why your losses are nan (which are not plotted).

gepaohhh commented 1 year ago

@glenn-jocher thankyou, later I found my losses are nan (which are not plotted) ,because there is something wrong in my CUDA and cuDNN, and the official network say due to my CUDA which is not suitable to my Convolution so you considered my dataset is good ? but i wonder if I only have one class of dataset , wheather this could effect my results ?, and can you give me some tips about 1 class train in yolov5 ? thank you

I'm sorry my english is not very well

glenn-jocher commented 1 year ago

@gepaohhh no changes are needed for single-class training, just label your dataset with class 0 and train normally.