yolov5-l模型压缩至yolov5-s 压缩算法是 https://github.com/twangnh/Distilling-Object-Detectors
Install
Python >= 3.6.0 required with all requirements.txt dependencies installed:
$ git clone https://github.com/magicshuang/yolov5_distillation
$ cd magicshuang/yolov5_distillation
$ pip install -r requirements.txt
Training
没有teacher模型的人,先训练teacher模型
$ python train.py --data coco.yaml --cfg yolov5s.yaml --weights '' --batch-size 64
yolov5m 40
yolov5l 24
yolov5x 16
Distillation Training
$ python Distill_train.py --data coco.yaml --teacher-weights [your path] --batch-size 64
比yolov5源码只多了两个文件 Distill_train.py & utils/distill_fun.py
所以可以直接下载这两个文件就可以了