ZJU-lishuang / yolov5_prune

yolov5 prune,Support V2, V3, V4 and V6 versions of yolov5
Apache License 2.0
560 stars 137 forks source link

yolov5s_hand.yaml内容与原版yolov5s.yaml不一致 #9

Closed eeric closed 3 years ago

eeric commented 3 years ago

yolov5s_hand.yaml的内容是对模型结构的重新定义,是分拆的吧,与原版yolov5内容不一致,这样就得以你定义的yaml重新训练模型,在稀疏训练,再剪枝和微调。 能不能直接用原版yolov5.yaml预训练的模型,直接稀疏训练,再剪枝和微调呢?

EricHuiK commented 3 years ago

我也发现了好多错误,没法复现

ZJU-lishuang commented 3 years ago

The different between yolov5s_hand.yaml and yolov5s.yaml only is the num of class. I have provided my training file in google cloud disk. I think it is easy to reproduce it and make a compare. If there is a bug, please show me the code.Talk is cheap.

ZJU-lishuang commented 3 years ago

@eeric Training the coco dataset need a lot of computing resources. You can try it by yourself.

eeric commented 3 years ago

你为什么不用原版yolov5s.yaml训练呢,你可以把类数量修改吧。如果想要GPU资源少,可以减少通道数或block数量,而不应该改变它的结构,如果你按照它原来的模型设计,读者就可以清楚看到如何准确找到BN层,如何对后面的相邻层通道进行剪枝吧。 如果你拆开模型结构成为单层堆叠形式,那么就失去了如何找到yolov5s模型结构当中的BN层的方法意义了。

ZJU-lishuang commented 3 years ago

The different between yolov5s_hand.yaml and yolov5s.yaml only is the num of class.The network structure is the same. Can you tell me the different between the yolov5s_hand.yaml and yolov5s.yaml except the num of class.

eeric commented 3 years ago

我是希望你能基于原版.yaml做成一套剪枝方法,而不是等同于把原网络结构拆解,再按推断顺序不变的方式吧。

ZJU-lishuang commented 3 years ago

I have not a good idea for the analysis of network structure in yaml.The index of layer in yaml is not friendly to prune. We need to build another set of tools to do it. But this project is based on tanluren/yolov3-channel-and-layer-pruning.

eeric commented 3 years ago

ok, thanks!

ZJU-lishuang commented 3 years ago

First time I have a try on yaml and find it unfriendly for the terrible layer name.Just like layer_name[].BottleneckCSP.cv1.conv,arr and dict are mixed together.It bad for prune adjacent channel.