TensorFlow2.0-Examples icon indicating copy to clipboard operation
TensorFlow2.0-Examples copied to clipboard

Happened IndexError: index 52 is out of bounds for axis 1 with size 52!

Open chajnoven opened this issue 6 years ago • 5 comments

` IndexError Traceback (most recent call last) /content/train.py in () 73 74 for epoch in range(cfg.TRAIN.EPOCHS): ---> 75 for image_data, target in trainset: 76 train_step(image_data, target) 77 model.save_weights("./yoface")

1 frames /content/core/dataset.py in preprocess_true_boxes(self, bboxes) 230 xind, yind = np.floor(bbox_xywh_scaled[best_detect, 0:2]).astype(np.int32) 231 --> 232 label[best_detect][yind, xind, best_anchor, :] = 0 233 label[best_detect][yind, xind, best_anchor, 0:4] = bbox_xywh 234 label[best_detect][yind, xind, best_anchor, 4:5] = 1.0

IndexError: index 52 is out of bounds for axis 1 with size 52 `

As it shows, I use widerface dataset to train my model but it happened indexError, it seems some problem with my code, please help me to solve it.

chajnoven avatar Nov 23 '19 10:11 chajnoven

How many classes

YunYang1994 avatar Nov 23 '19 10:11 YunYang1994

one class

only have a class named "person" in the file "./data/classes/yolo.names"

chajnoven avatar Nov 23 '19 10:11 chajnoven

that maybe the center of some bounding boxes are out range of image

YunYang1994 avatar Nov 23 '19 17:11 YunYang1994

that maybe the center of some bounding boxes are out range of image

Thanks, I have solved the problem, because the widerface dataset's labels have some problems

chajnoven avatar Nov 24 '19 14:11 chajnoven

that maybe the center of some bounding boxes are out range of image

Thanks, I have solved the problem, because the widerface dataset's labels have some problems

How did you solve this problem? I have the same one and don't know how to fix it.

zanasko avatar Dec 11 '19 16:12 zanasko