WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.19k stars 4.17k forks source link

change the backbone but make error :c2 = sum([ch[x] for x in f]) IndexError: list index out of range #1253

Open FisherDom opened 1 year ago

FisherDom commented 1 year ago

there are my log

             from  n    params  module                                  arguments                     

0 -1 1 464 models.common.conv_bn_hswish [3, 16, 2]
1 -1 1 612 models.common.MobileNetV3_InvertedResidual[16, 16, 16, 3, 2, 1, 0]
2 -1 1 3864 models.common.MobileNetV3_InvertedResidual[16, 24, 72, 3, 2, 0, 0]
3 -1 1 5416 models.common.MobileNetV3_InvertedResidual[24, 24, 88, 3, 1, 0, 0]
4 -1 1 13736 models.common.MobileNetV3_InvertedResidual[24, 40, 96, 5, 2, 1, 1]
5 -1 1 55340 models.common.MobileNetV3_InvertedResidual[40, 40, 240, 5, 1, 1, 1]
6 -1 1 55340 models.common.MobileNetV3_InvertedResidual[40, 40, 240, 5, 1, 1, 1]
7 -1 1 21486 models.common.MobileNetV3_InvertedResidual[40, 48, 120, 5, 1, 1, 1]
8 -1 1 28644 models.common.MobileNetV3_InvertedResidual[48, 48, 144, 5, 1, 1, 1]
9 -1 1 91848 models.common.MobileNetV3_InvertedResidual[48, 96, 288, 5, 2, 1, 1]
10 -1 1 294096 models.common.MobileNetV3_InvertedResidual[96, 96, 576, 5, 1, 1, 1]
11 -1 1 294096 models.common.MobileNetV3_InvertedResidual[96, 96, 576, 5, 1, 1, 1]
12 -1 1 203360 models.common.SPPF [96, 1024, 5]
13 -1 1 262656 models.common.Conv [1024, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 14 -2 1 262656 models.common.Conv [1024, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 15 -1 1 0 models.common.SP [5]
16 -2 1 0 models.common.SP [9]
17 -3 1 0 models.common.SP [13]
18 [-1, -2, -3, -4] 1 0 models.common.Concat [1]
19 -1 1 262656 models.common.Conv [1024, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 20 [-1, -7] 1 0 models.common.Concat [1]
21 -1 1 131584 models.common.Conv [512, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 22 -1 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 23 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
24 21 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 25 [-1, -2] 1 0 models.common.Concat [1]
26 -1 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 27 -2 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 28 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 29 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 30 [-1, -2, -3, -4] 1 0 models.common.Concat [1]
31 -1 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 32 -1 1 8320 models.common.Conv [128, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 33 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
34 14 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 35 [-1, -2] 1 0 models.common.Concat [1]
36 -1 1 4160 models.common.Conv [128, 32, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 37 -2 1 4160 models.common.Conv [128, 32, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 38 -1 1 9280 models.common.Conv [32, 32, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 39 -1 1 9280 models.common.Conv [32, 32, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 40 [-1, -2, -3, -4] 1 0 models.common.Concat [1]
41 -1 1 8320 models.common.Conv [128, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 42 -1 1 73984 models.common.Conv [64, 128, 3, 2, None, 1, LeakyReLU(negative_slope=0.1)] Traceback (most recent call last): File "train.py", line 616, in train(hyp, opt, device, tb_writer) File "train.py", line 95, in train model = Model(opt.cfg, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/home/user2/yinjiacheng/pytorch-ssd/yolov7/models/yolo.py", line 529, in init self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist File "/home/user2/yinjiacheng/pytorch-ssd/yolov7/models/yolo.py", line 792, in parse_model c2 = sum([ch[x] for x in f]) File "/home/user2/yinjiacheng/pytorch-ssd/yolov7/models/yolo.py", line 792, in c2 = sum([ch[x] for x in f]) IndexError: list index out of range

RunaprograM commented 1 month ago

did you fix? facing same error , how to?