question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IndexError while evaluate on COCO

See original GitHub issue

When I run ssd300_evaluation_COCO.ipynb, an IndexError came out. I just modified the path and nothing more.

IndexError                                Traceback (most recent call last)
<ipython-input-11-2145451281d3> in <module>()
     11                     iou_threshold=0.45,
     12                     top_k=200,
---> 13                     normalize_coords=True)

~/ssd_keras/eval_utils/coco_utils.py in predict_all_to_json(out_file, model, img_height, img_width, classes_to_cats, data_generator, batch_size, data_generator_mode, model_mode, confidence_thresh, iou_threshold, top_k, pred_coords, normalize_coords)
    151     for i in tr:
    152         # Generate batch.
--> 153         batch_X, batch_image_ids, batch_inverse_transforms = next(generator)
    154         # Predict.
    155         y_pred = model.predict(batch_X)

~/ssd_keras/data_generator/object_detection_2d_data_generator.py in generate(self, batch_size, shuffle, transformations, label_encoder, returns, keep_images_without_gt, degenerate_box_handling)
    743 
    744                 # Check for degenerate ground truth bounding boxes before attempting any computations.
--> 745                 if np.any(batch_y[i][:,xmax] - batch_y[i][:,xmin] <= 0) or np.any(batch_y[i][:,ymax] - batch_y[i][:,ymin] <= 0):
    746                     if degenerate_box_handling == 'warn':
    747                         warnings.warn("Detected degenerate ground truth bounding boxes for batch item {} with bounding boxes {}, ".format(i, batch_y[i]) +

IndexError: list index out of range

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pierluigiferraricommented, Apr 22, 2018

For inference we don’t want the uncertain predictions, but for the evaluation we do.

In order to reach high recall values in the computation of the precision-recall-curve you need predictions at various confidence levels well below 0.5.

1reaction
pierluigiferraricommented, Apr 22, 2018

Thank you for reporting this, that’s indeed a bug. The generator tries to check for degenerate ground truth boxes even though there are no ground truth boxes.

I will push a fix later today. In the meantime you could fix this locally by adding the line if not (self.labels is None): just before the code block that checks for degenerate boxes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Index Error in Evaluation on COCO test set · Issue #100 · ruotianluo ...
Hi Ruotian, I tried to run the evaluation on COCO test set and encountered the following problem: python tools/eval.py --input_json cocotest.json ...
Read more >
COCO Keypoint Challenge Forum - CodaLab
I zip sucessfully uploaded and finishing evaluation. two things i changed. 1. problem at image ids. i saved them as string.(it's my bad)...
Read more >
Index out of range error while training dataset - Stack Overflow
Error is telling every thing you are trying to access an index from list self.masks which does not exist issue is in this...
Read more >
How to Train an Object Detection Model with Keras
How to use transfer learning to train an object detection model on a new dataset. How to evaluate a fit Mask R-CNN model...
Read more >
List Index Out of Range – Python Error Message Solved
In this article you'll see a few of the reasons that cause the list index out of range Python error. Besides knowing why...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found