New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义网络剪枝问题请教 #23
Comments
请问对网络结构修改了哪些部分?报错信息是什么? |
[-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 去掉32倍特征图输出 去掉了,在head里面,对p2检测头做了上采样,为了提取更小目标的特征。p5检测头输出也去了,只有p2,p3,p4(4,8,16)输出 |
你好,已解决。 |
非常即时,非常棒,通过测试,之前的错误已经解决了,希望提供一个捐赠渠道,感谢作者的辛苦。 |
作者现有的剪枝,经过测试非常有效,现有对网络修改后,再运行剪枝失败,请指教:# parameters
nc: 1 # number of classes
depth_multiple: 0.33 # model depth multiple
width_multiple: 0.50 # layer channel multiple
anchors
anchors:
#- [116,90, 156,198, 373,326] # P5/16
#- 4,4, 5,5, 5,5, 5,5, 5,5, 6,6, 6,6, 7,7, 8,8
YOLOv5 backbone
backbone:
[from, number, module, args]
[from, number, module, args]
[ [ -1, 1, Conv, [ 64, 6, 2, 2, 1, True, 1.0 ] ], # 0-P1/2
[ -1, 1, Conv, [ 128, 3, 2, None, 1, True, 1.0 ] ], # 1-P2/4
[ -1, 3, C3, [ 128, True, 1, [ 0.5, 0.5 ], [ 1.0, 1.0, 1.0 ], 1.0 ] ],
[ -1, 1, Conv, [ 256, 3, 2, None, 1, True, 1.0 ] ], # 3-P3/8
[ -1, 6, C3, [ 256, True, 1, [ 0.5, 0.5 ], [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], 1.0 ] ],
[ -1, 1, Conv, [ 512, 3, 2, None, 1, True, 1.0 ] ], # 5-P4/16
[ -1, 9, C3, [ 512, True, 1, [ 0.5, 0.5 ], [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ], 1.0 ] ],
[-1, 1, Conv, [1024, 3, 2]], # 7-P5/32 去掉32倍特征图输出
]
YOLOv5 v6.0 head
head:
[[-1, 1, Conv, [512, 1, 1, None, 1, True, 1.0]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']],
[[-1, 4], 1, Concat, [1]], # cat backbone P3
[-1, 3, C3, [512, False, 1, [0.5, 0.5], [1.0, 1.0, 1.0], 1.0]], # 17 (P3/8-small)
[ -1, 1, Conv, [256, 1, 1, None, 1, True, 1.0]],
[ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
[ [ -1, 2 ], 1, Concat, [ 1 ] ], # cat backbone P2 160*160
[ -1, 3, C3, [256, False, 1, [0.5, 0.5], [1.0, 1.0, 1.0], 1.0]], # 16 (P2/4-small)
[-1, 1, Conv, [256, 3, 2, None, 1, True, 1.0]],
[[-1, 13], 1, Concat, [1]], # cat head P2
[-1, 3, C3, [256, False, 1, [0.5, 0.5], [1.0, 1.0, 1.0], 1.0]], # 20 (P3/16-medium)
[-1, 1, Conv, [256, 3, 2, None, 1, True, 1.0]],
[[-1, 9], 1, Concat, [1]], # cat head P4
[-1, 3, C3, [512, False, 1, [0.5, 0.5], [1.0, 1.0, 1.0], 1.0]], # 22 (P4/16-large)
[[16, 19, 22], 1, Detect, [nc, anchors]], # Detect(P2, P3, P4)
]
The text was updated successfully, but these errors were encountered: