You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
假设训练5个类,在训练的时候每一帧图像对应的标签,类别号如果是0-4中间有缺失,比如标签中只有0类和2类,就会出现最后一个类别号越界的错误:
以下是我打印的一个models.py的第332行的cls_id, nID,以及334行的self.id_classifiers,
0 3==========
2 3==========
ModuleList(
(0): Linear(in_features=128, out_features=3, bias=True)
(1): Linear(in_features=128, out_features=3, bias=True)
) 33333333333333
Model Summary: 91 layers, 6.67257e+06 parameters, 6.67257e+06 gradients
Caching labels (1 found, 0 missing, 0 empty, 0 duplicate, for 1 images): 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 979.06it/s]
Image sizes 384 - 832 train, 768 test
Using 0 dataloader workers
Starting training for 100 epochs...
Epoch gpu_mem GIoU obj cls reid total targets img_size
0%| | 0/1 [00:00<?, ?it/s]
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/11/YOLOV4_MCMOT-master/utils/utils.py", line 501, in compute_loss_no_upsample
fc_preds = model.id_classifiers[cls_id].forward(id_vects).contiguous()
File "/home/11/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 164, in getitem
return self._modules[self._get_abs_string_index(idx)]
File "/home/11/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 154, in _get_abs_string_index
raise IndexError('index {} is out of range'.format(idx))
IndexError: index 2 is out of range
假设训练5个类,在训练的时候每一帧图像对应的标签,类别号如果是0-4中间有缺失,比如标签中只有0类和2类,就会出现最后一个类别号越界的错误:
以下是我打印的一个models.py的第332行的cls_id, nID,以及334行的self.id_classifiers,
0 3==========
2 3==========
ModuleList(
(0): Linear(in_features=128, out_features=3, bias=True)
(1): Linear(in_features=128, out_features=3, bias=True)
) 33333333333333
Model Summary: 91 layers, 6.67257e+06 parameters, 6.67257e+06 gradients
Caching labels (1 found, 0 missing, 0 empty, 0 duplicate, for 1 images): 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 979.06it/s]
Image sizes 384 - 832 train, 768 test
Using 0 dataloader workers
Starting training for 100 epochs...
0%| | 0/1 [00:00<?, ?it/s]
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/11/YOLOV4_MCMOT-master/utils/utils.py", line 501, in compute_loss_no_upsample
fc_preds = model.id_classifiers[cls_id].forward(id_vects).contiguous()
File "/home/11/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 164, in getitem
return self._modules[self._get_abs_string_index(idx)]
File "/home/11/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 154, in _get_abs_string_index
raise IndexError('index {} is out of range'.format(idx))
IndexError: index 2 is out of range
该处是不是应该修改一下,以适应上述中的情况。
@CaptainEven
The text was updated successfully, but these errors were encountered: