OICR-PyTorch icon indicating copy to clipboard operation
OICR-PyTorch copied to clipboard

Possible fix for 'RuntimeError: boxes should have 4 elements in dimension 1, got 5' in test_utils.py

Open pythonista-blitz opened this issue 2 years ago • 0 comments

When I ran 'test.py', I encountered an error which read # RuntimeError: boxes should have 4 elements in dimension 1, got 5.

The problem was caused by the following line in test_utils.py, line 46: keep = nms(torch.tensor(dets_j), torch.tensor(scores_j), torch.tensor(cfg.TEST.NMS)).

I believe the issue may be resolved by changing the line to: keep = nms(torch.tensor(boxes_j), torch.tensor(scores_j), torch.tensor(cfg.TEST.NMS))

Although I'm aware that I should submit a pull request, I have already made several changes to the code.

Thank you very much for your helpful code.

pythonista-blitz avatar Feb 22 '23 04:02 pythonista-blitz