CaptainEven / YOLOV4_MCMOT

Using YOLOV4 as detector for MCMOT.
MIT License
104 stars 28 forks source link

一个训练时候遇到的问题 #7

Closed starsky68 closed 3 years ago

starsky68 commented 3 years ago

Traceback (most recent call last): File "train.py", line 660, in train() # train normally File "train.py", line 452, in train loss, loss_items = compute_loss_no_upsample(pred, reid_feat_out, targets, track_ids, model) File "/home/--/MCMOT_YOLOV4_dev/utils/utils.py", line 416, in compute_loss_no_upsample id_map_w, id_map_h = reid_feat_out[i].shape[3], reid_feat_out[i].shape[2] # 3 feature map layers AttributeError: 'list' object has no attribute 'shape'

把改行使用np.array转成array会出下面的错误 id_map_w, id_map_h = np.array(reid_feat_out)[i].shape[3], np.array(reid_feat_out)[i].shape[2] # 3 feature map layers AttributeError: 'int' object has no attribute 'array'

使用torch.tensor转换的时候会出现: id_map_w, id_map_h = torch.tensor(reid_feat_out)[i].shape[3], torch.tensor(reid_feat_out)[i].shape[2] # 3 feature map layers IndexError: tuple index out of range

我发现在models.py中,这几个out中的元素都是 [] 空的: out.append(x if self.routs[i] else []) if verbose: print('%g/%g %s -' % (i, len(self.module_list), name), list(x.shape), str) str = ''

Get 3 feature map layers for reid feature vector extraction

    reid_feat_out.append(out[-5])
    reid_feat_out.append(out[-3])
    reid_feat_out.append(out[-1])

@CaptainEven 请问该变量的问题如何解决?请问空的元素是问题的原因吗?

starsky68 commented 3 years ago

@CaptainEven 可以提供一下你的cfg(yolov4-tiny-3l_no_group_id_no_upsample.cfg)文件吗?

CaptainEven commented 3 years ago

@starsky68 已上传