WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.34k stars 4.21k forks source link

Pre-trained weights even when training from scratch? #248

Open DP1701 opened 2 years ago

DP1701 commented 2 years ago

Hello, in YOLOv5 it is recommended that the pre-trained weights should be included in the training if this is also done from scratch. What about YOLOv7?

WongKinYiu commented 2 years ago

By definition, train from scratch does not use pre-trained weights.

DP1701 commented 2 years ago

I did not know that until now. Is there a paper or book that defines this? Interesting that the authors of YOLOv5 recommend the use of pre-trained weights.

DP1701 commented 2 years ago

If I understand this correctly, pre-trained weights are ignored in YOLOv7 if I indicate them with --weights yolov7.pt ?

WongKinYiu commented 2 years ago

Use pre-trained weights may get better AP, but it need similar large dataset and very long pre-training time.

JustVietNH commented 2 years ago

If I understand this correctly, pre-trained weights are ignored in YOLOv7 if I indicate them with --weights yolov7.pt ?

No. Using the --weights argument and adding the yolov7.pt leads to fine tuning of the model, if you talking about the training implementation of this repo.

If you want to train from scratch, you indicate it by adding "" (an empty string) to the --weights argument. Not adding the the weights argument leads to fine tuning of the model (training with pre-trained weights) by default!

DP1701 commented 2 years ago

I got it. Thank you for the explanation!