Lam1360 / YOLOv3-model-pruning

在 oxford hand 数据集上对 YOLOv3 做模型剪枝(network slimming)
MIT License
1.67k stars 432 forks source link

prune_model_keep_size 只是将model中冗余的通道通过mask置零,并没有真正的剪掉这些通道? #90

Closed tangchen2 closed 3 years ago

tangchen2 commented 3 years ago

prune_utils.py中的prune_model_keep_size,pruned_model似乎只是将原来记录的pruned param给赋值过去了,仍然是256,512这些维度,mask=0的通道在模型中仍然存在,并没有真正的剪掉?那么模型的尺寸就不会缩小了吧?

tangchen2 commented 3 years ago

代码中是通过修改cfg的方式重新生成剪枝后的model的,pruned model只是将权重置零,compact model才是真正剪枝的model close issue