赞
踩
# YOLOv5 v6.0 head
head:
[[-1, 1, Conv, [512, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']], # the origin nn.Upsample layer
# [-1, 1, nn.ConvTranspose2d, [512, 2, 2]], # nn.ConvTransposed2d with 2x2 deconv kernel
# [-1, 1, nn.ConvTranspose2d, [512, 4, 2, 1]], # nn.ConvTransposed2d with 4x4 deconv kernel
[[-1, 6], 1, Concat, [1]], # cat backbone P4
[-1, 3, C3, [512, False]], # 13
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, 'nearest']], # the origin nn.Upsample layer
# [-1, 1, nn.ConvTranspose2d, [256, 2, 2]], # nn.ConvTransposed2d with 2x2 deconv kernel
# [-1, 1, nn.ConvTranspose2d, [256, 4, 2, 1]], # nn.ConvTransposed2d with 4x4 deconv kernel
[[-1, 4], 1, Concat, [1]], # cat backbone P3
[-1, 3, C3, [256, False]], # 17 (P3/8-small)
[-1, 1, Conv, [256, 3, 2]],
[[-1, 14], 1, Concat, [1]], # cat head P4
[-1, 3, C3, [512, False]], # 20 (P4/16-medium)
[-1, 1, Conv, [512, 3, 2]],
[[-1, 10], 1, Concat, [1]], # cat head P5
[-1, 3, C3, [1024, False]], # 23 (P5/32-large)
[[17, 20, 23], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)]
return torch.cat(x, self.d)
RuntimeError: torch.cat(): Sizes of tensors must match except in dimension 1. Got 266 and 16 in dimension 2 (The offending index is 1)
出现上面问题
参考:
Do Upsample with ConvTranspose2d · Issue #7520 · ultralytics/yolov5 · GitHub
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。