NameError: name ‘DWConvTranspose2d‘ is not defined【yolov5自训练报错日志及解决】
运行训练时报错:NameError: name 'DWConvTranspose2d' is not defined
·
模型前提:采用Efficient VIT改进yolov5
Q:运行训练时报错:
NameError: name 'DWConvTranspose2d' is not defined


S:在common.py下创建该类:
class DWConvTranspose2d(nn.ConvTranspose2d):
# Depth-wise transpose convolution
def __init__(self, c1, c2, k=1, s=1, p1=0, p2=0): # ch_in, ch_out, kernel, stride, padding, padding_out
super().__init__(c1, c2, k, s, p1, p2, groups=math.gcd(c1, c2))

更多推荐



所有评论(0)