coldlarry / YOLOv3-complete-pruning

提供对YOLOv3及Tiny的多种剪枝版本,以适应不同的需求。
805 stars 214 forks source link

精度下降严重 #73

Open YONGHUICAI opened 4 years ago

YONGHUICAI commented 4 years ago

作者您好,我根据您的步骤,发现剪枝后精度下降比较厉害,在剪枝率=0.1的时候,mAP=0.793179,当时推理时间反而变长了;在剪枝率=0.2的时候,mAP=0.693096 ;在剪枝率=0.5时,mAP=0,推理时已经完全没有输出检测框了。我运行的步骤是先运行第二步的稀疏化训练,然后执行第三步的规整剪枝,请问一下我是哪个环节出现问题了吗?

规整剪枝的结果: 1)percent=0.1时: +------------+----------+----------+ | Metric | Before | After | +------------+----------+----------+ | mAP | 0.812109 | 0.793179 | | Parameters | 61523734 | 60048534 | | Inference | 0.1162 | 0.1154 | +------------+----------+----------+ Config file has been saved: cfg/prune_0.1_yolov3-hand.cfg Compact model has been saved: weights/yolov3_hand_regular_pruning_0.1percent.weights

2)percent=0.2时: +------------+----------+----------+ | Metric | Before | After | +------------+----------+----------+ | mAP | 0.812109 | 0.693096 | | Parameters | 61523734 | 52141142 | | Inference | 0.1036 | 0.1764 | +------------+----------+----------+ Config file has been saved: cfg/prune_0.2_yolov3-hand.cfg Compact model has been saved: weights/yolov3_hand_regular_pruning_0.2percent.weights

3)percent=0.5时: +------------+----------+----------+ | Metric | Before | After | +------------+----------+----------+ | mAP | 0.812109 | 0.000000 | | Parameters | 61523734 | 14787023 | | Inference | 0.1010 | 0.0495 | +------------+----------+----------+ Config file has been saved: cfg/prune_0.5_yolov3-hand.cfg Compact model has been saved: weights/yolov3_hand_shortcut_pruning_0.5percent.weights

CheungBH commented 4 years ago

大概率没稀疏好,先判断以下稀疏效果再剪枝吧。实际上有些网络就算mAP变0,微调后依然能回到不错的水准

forwardwfg commented 3 years ago

请问解决了吗,我也遇到类似的情况

Serissa commented 2 years ago

大概率没稀疏好,先判断以下稀疏效果再剪枝吧。实际上有些网络就算mAP变0,微调后依然能回到不错的水准

请问稀疏化训练好-大概需要训练多少epoch?或者在loss或者mAP波动很小后还要训练多少epoch?