Torch-Pruning icon indicating copy to clipboard operation
Torch-Pruning copied to clipboard

yolov8剪枝前后权重大小没变,推理速度也没变

Open Goddaman opened this issue 8 months ago • 4 comments

用的是examples里面的yolov8_pruning

剪枝完成后,打印语句 After pruning iter 12: MACs=7.6973132 G, #Params=5.751394 M, mAP=0.7409106360181956, speed up=1.854154563958759 After fine tuning mAP=0.8953202549181167

虽然它说参数量下降、速度提升,但是生成的onnx权重和pt权重大小均未改变,推理时速度也没变,用的GPU推理

Goddaman avatar May 23 '25 02:05 Goddaman

权重大小没变是因为target-prune-rate设置的不够大,设置成0.5,权重就变小了。

但是在gpu上的推理速度仍然没有改变,在cpu上剪枝后的推理速度是推理前的1.59倍。

我想问一下,为什么在gpu上的推理速度没有变快啊?

Goddaman avatar May 24 '25 11:05 Goddaman

how about the mAP metrics between base and pruned model? @Goddaman

austingg avatar Jun 08 '25 01:06 austingg

Hi! If you're interested in pruning YOLOv8, YOLOv10 and YOLOv11 models, feel free to check out this repo: https://github.com/heyongxin233/YOLO-Pruning-RKNN. Hope it helps!

heyongxin233 avatar Jun 30 '25 12:06 heyongxin233

我的结果更奇怪,剪枝后参数量没变 Before Pruning: MACs=14.414051 G, #Params=0.037923 G After Pruning: MACs=14.414051 G, #Params=0.037923 G

PHaiJun avatar Aug 07 '25 06:08 PHaiJun