Focal_loss_for_object_detection icon indicating copy to clipboard operation
Focal_loss_for_object_detection copied to clipboard

IndexError: too many indices for tensor of dimension 1

Open sunshine-zkf opened this issue 5 years ago • 0 comments

I use the function decode in the encoder.py, always have the fellowing question.

Traceback (most recent call last):
File "eval.py", line 281, in
test()
File "eval.py", line 238, in test
boxes, labels, scores = encoder.decode(loc_preds.data.squeeze(), cls_preds.data.squeeze(), (w, h))
File "/home/sunshine_zkf/RetinaNet/RetinaNet/encoder.py", line 127, in decode
keep = box_nms(boxes[ids], score[ids], threshold=NMS_THRESH)
File "/home/sunshine_zkf/RetinaNet/RetinaNet/utils.py", line 168, in box_nms
x1 = bboxes[:,0] # xmin
IndexError: too many indices for tensor of dimension 1

where's the problem? I use the pytorch-0.4

sunshine-zkf avatar Jul 05 '19 08:07 sunshine-zkf