yzqxy / Yolov8_obb_Prune_Track

GNU General Public License v3.0
181 stars 14 forks source link

RuntimeError: nonzero is not supported for tensors with more than INT_MAX elements, file a support request #23

Open XiaoJiNu opened 1 year ago

XiaoJiNu commented 1 year ago

When I use batch 64, occurs an error as following:

Traceback (most recent call last): File "train.py", line 648, in main(opt) File "train.py", line 545, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 332, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/loss.py", line 87, in call anchor_points stride_tensor, gt_labels, gt_bboxes, mask_gt) File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, *kwargs) File "/opt/conda/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(args, *kwargs) File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/tal.py", line 135, in forward mask_gt) File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/tal.py", line 157, in get_pos_mask align_metric, overlaps = self.get_box_metrics(pd_scores, pd_bboxes, gt_labels, gt_bboxes,mask_in_gts mask_gt) File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/tal.py", line 176, in get_box_metrics bbox_scores[mask_gt] = pd_scores[ind[0], :, ind[1]][mask_gt] # b, max_num_obj, h*w RuntimeError: nonzero is not supported for tensors with more than INT_MAX elements, file a support request

how to fix this bug ?

yzqxy commented 1 year ago

When I use batch 64, occurs an error as following:

Traceback (most recent call last): File "train.py", line 648, in main(opt) File "train.py", line 545, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 332, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/loss.py", line 87, in call anchor_points stride_tensor, gt_labels, gt_bboxes, mask_gt) File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/opt/conda/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(_args, kwargs) File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/tal.py", line 135, in forward mask_gt) File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/tal.py", line 157, in get_pos_mask align_metric, overlaps = self.get_box_metrics(pd_scores, pd_bboxes, gt_labels, gt_bboxes,mask_in_gts * mask_gt) File "/cpfs/user/pengwan5/yr/code/yolov8_all/Yolov8_obb_Prune_Track-main/utils/tal.py", line 176, in get_box_metrics bbox_scores[mask_gt] = pd_scores[ind[0], :, ind[1]][mask_gt] # b, max_num_obj, h_w RuntimeError: nonzero is not supported for tensors with more than INT_MAX elements, file a support request

how to fix this bug ?

New code has fixed this bug ,You need to replace this function (utils/tal.py---get_box_metrics)

XiaoJiNu commented 1 year ago

ok, I will update the code, thank you @yzqxy