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.26k stars 4.18k forks source link

YOLOv7 freeze train #1468

Open mengflow opened 1 year ago

mengflow commented 1 year ago

1、As for the normal YOLOv7 model, there are the weight files yolov7.pt and yolov7_training.pt present in the repo (see here). What´s the difference between these two and which should be used in which occasion? 2、Also there's a yolov7-tiny.pt weight file, but no respective yolov7-tiny_training.pt file. Is there a particular reason for that?

3、Also I learned that for Transfer Learning it's helpful to "freeze" the base models weights (make them untrainable) first, then train the new model on the new dataset, so only the new weights get adjusted. After that you can "unthaw" the frozen weights to fine-tune the entire model. The train.py script has a --freeze argument to freeze backbone layers. Is this approach recommended for retraining YOLOv7? 4、If so, should you freeze all 50 backbone layers of YOLOv7 (and would that command be --freeze 50 or smth. different)? And how would you then unthaw these layers and resume the training of said model?

yulin010101 commented 1 year ago

For pt file you could refer to #901. For freezing you can experiment to see the effect and --freeze 50 should work.

sristihere commented 3 months ago

Where can I get the exact layers numbers to freeze in yolov7