ssd.pytorch icon indicating copy to clipboard operation
ssd.pytorch copied to clipboard

img, boxes, labels = self.transform(img, target[:, :4], target[:, 4]) IndexError: too many indices for array

Open SpringUp opened this issue 5 years ago • 4 comments

SpringUp avatar Nov 05 '19 06:11 SpringUp

i meet the same error have you solve it?

neverstoplearn avatar Dec 13 '19 04:12 neverstoplearn

I remember it seems that there is a problem with the annotation of an original image,you can try to print the image index to determine which image has the problem.

SpringUp avatar Dec 13 '19 07:12 SpringUp

If the training test has no objects, then the negative samples are not labeled, showing how to resolve this error

GuoJingWeng avatar Mar 17 '20 03:03 GuoJingWeng

I checked the index when IndexError was raised, and found out that it's parameter #difficult#'s fault in my case. If you click "difficult" when labeling your data, you'll have difficult = int(obj.find('difficult').text) == 1 True, and it turns out " res = []"

ZQ-bit avatar Jan 17 '21 09:01 ZQ-bit