解决办法:根据报错信息,找到common.py
AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from 'E:\\All_in\\新建文件夹\\yolo_double\\yolov5_stereo_Pro\\models\\common.py'>
在spp上面添加SPPF类:
class SPPF(nn.Module):
def __init__(self, c1, c2, k=5):
super().__init__()
c_ = c1 // 2
self.cv1 = Conv(c1, c_, 1, 1)
self.cv2 = Conv(c_ * 4, c2, 1, 1)
self.m = nn.MaxPool2d(kernel_size=k, stride=1, padding=k // 2)
之后warnings会被标红,选中点击 导入‘warnings’
继续报错: