ultralytics / yolov5

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

Doubts about the YOLOV5-P4 training process #3766

Closed hhaAndroid closed 3 years ago

hhaAndroid commented 3 years ago

❔Question

Thank you for open source such excellent code. I read the weights after training and found that the BN parameter is nn.BatchNorm2d(c2, momentum=0.03, eps=0.001), but the code is the default value nn.BatchNorm2d(c2), and the training description is python train.py --data coco.yaml --cfg yolov5s.yaml --weights '' --batch-size 64, He did not adopt evolutionary strategies. so this why?

glenn-jocher commented 3 years ago

@hhaAndroid https://github.com/ultralytics/yolov5/blob/03281f8c7613ad808d7d356f0195152b2d46ab99/utils/torch_utils.py#L152-L162

hhaAndroid commented 3 years ago

@glenn-jocher Oh, It's so magical, it will actually be in the parameter initialization.

glenn-jocher commented 3 years ago

@hhaAndroid yes we call this function when creating a model here: https://github.com/ultralytics/yolov5/blob/374957317a5469742b24291caa52dedfd9d31c99/models/yolo.py#L114-L118

hhaAndroid commented 3 years ago

@glenn-jocher Thank you