wangermeng2021 / Scaled-YOLOv4-tensorflow2

A Tensorflow2.x implementation of Scaled-YOLOv4 as described in Scaled-YOLOv4: Scaling Cross Stage Partial Network
Apache License 2.0
47 stars 18 forks source link

Index out of bound #2

Closed jiuntian closed 3 years ago

jiuntian commented 3 years ago

Trying to train on tiny model with custom data and image_size 608, got the following error. Using coco format Any idea?

loading dataset...
  2% 2/88 [00:00<00:22,  3.77it/s]Traceback (most recent call last):
  File "train.py", line 298, in <module>
    main(args)
  File "train.py", line 194, in main
    coco_map_callback = CocoMapCallback(pred_generator,model,args,mAP_writer)
  File "/content/ScaledYOLOv4-tensorflow2/utils/fit_coco_map.py", line 30, in __init__
    for batch_img, batch_boxes, batch_valids in pred_generator_tqdm:
  File "/usr/local/lib/python3.7/dist-packages/tqdm/std.py", line 1104, in __iter__
    for obj in iterable:
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/utils/data_utils.py", line 483, in __iter__
    for item in (self[i] for i in range(len(self))):
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/utils/data_utils.py", line 483, in <genexpr>
    for item in (self[i] for i in range(len(self))):
  File "/content/ScaledYOLOv4-tensorflow2/generator/coco_generator.py", line 183, in __getitem__
    y_true = get_y_true(self.max_side, batch_boxes, groundtruth_valids, self._args)
  File "/content/ScaledYOLOv4-tensorflow2/generator/get_y_true.py", line 91, in get_y_true
    grids[grid_index][batch_index][grid_xy[1]][grid_xy[0]][grid_anchor_index][0:4] = np.concatenate([dxdy,dwdh])
IndexError: index 19 is out of bounds for axis 0 with size 19