Open Hazel-Xiang opened 2 years ago
def parse_pruned_model
commom.py中Concat_bifpn结构如下:
yolov5s_bifpn.yaml结构如下:
nc: 2 # number of classes depth_multiple: 0.33 # model depth multiple width_multiple: 0.50 # layer channel multiple
anchors:
backbone:
[[-1, 1, Focus, [64, 3]], # 0-P1/2 [-1, 1, Conv, [128, 3, 2]], # 1-P2/4 [-1, 3, C3, [128]], [-1, 1, Conv, [256, 3, 2]], # 3-P3/8 [-1, 9, C3, [256]], [-1, 1, Conv, [512, 3, 2]], # 5-P4/16 [-1, 9, C3, [512]], [-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 [-1, 1, SPP, [1024, [5, 9, 13]]], [-1, 3, C3, [1024, False]], # 9 ]
head: [[-1, 1, Conv, [512, 1, 1]], [-1, 1, nn.Upsample, [None, 2, 'nearest']], [[-1,6], 1, Concat_bifpn, [256,256]], # cat backbone P4 [-1, 3, C3, [512, False]], # 13
[-1, 1, Conv, [256, 1, 1]], [-1, 1, nn.Upsample, [None, 2, 'nearest']], [[-1, 4], 1, Concat_bifpn, [128,128]], # cat backbone P3 [-1, 3, C3, [256, False]], # 17 (P3/8-small)
[-1, 1, Conv, [512, 3, 2]], # 320, 640 # [[-1, 6, 13], 1, Concat_bifpn, [256,256]], # cat head P4 [-1, 3, C3, [512, False]], # 20 (P4/16-medium)
[-1, 1, Conv, [1024, 3, 2]], # 640, 1280 # [[-1, 9], 1, Concat_bifpn, [512, 512]], # cat head P5 cat 20,20 #22 [-1, 3, C3, [1024, False]], # 25 (P5/32-large) # 1280, 1280 #23
[[17, 20, 23], 1, Detect, [nc, anchors]] # Detect(P3, P4, P5) ]
Hello @Hazel-Xiang , how did you finish the pruning? What is the code modification idea?
你好,请问你有解决方法了吗?我现在也困在这里
作者大大,我想试着在yolov5结构的head和backbone里加入一些小的优化结构,在稀疏训练后,进行prune.py的时候报了错,按照错误修改yolo.py时遇见一些问题,请问作者大大def parse_pruned_model应该怎么修改呢?拜托作者大大了,请指教一下应该怎么修改和修改的思路!万分感谢! ![Uploading image.png…]()
commom.py中Concat_bifpn结构如下: ![Uploading image.png…]()