mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

data['category_id'] = self.cat_ids[label] IndexError: list index out of range

Open Brym-Gyimah opened this issue 1 year ago • 2 comments

Hey, I need help to figure this out. Been stack on it for days now.

Brym-Gyimah avatar Sep 27 '23 21:09 Brym-Gyimah

我也遇到了同样的问题

meng8407 avatar Apr 19 '24 07:04 meng8407

我也遇到了同样的问题 I also encountered this problem, after debugging, I found that the array self.cat_ids may not be able to read all the ids, in my case, my category ids should have been 1-12,but during debugging I had self.cat_ids=[1,2,3,4,5,6,7,8,9,11,12], which was missing the 10 element, so it results in the label and the read ids not being aligned, what I do at this point is create another origin_cat_ids array equal to [1,2.... .12] and assign it to self.cat_ids to force the labels to be aligned. i have successfully resolved this error by doing this. (If you want to change the dataset, you'll have to rethink the missing labels, but if the error message is the same and your num_classes parameter in the HEAD section is not set incorrectly, you can change it the way I said)

lilitao0517 avatar May 24 '24 06:05 lilitao0517