diff --git a/tensorflow/lite/kernels/detection_postprocess.cc b/tensorflow/lite/kernels/detection_postprocess.cc index 8285b4d9b84..6055070af40 100644 --- a/tensorflow/lite/kernels/detection_postprocess.cc +++ b/tensorflow/lite/kernels/detection_postprocess.cc @@ -498,7 +498,7 @@ TfLiteStatus NonMaxSuppressionMultiClassRegularHelper(TfLiteContext* context, int size_of_sorted_indices = 0; std::vector sorted_indices; - sorted_indices.resize(max_detections); + sorted_indices.resize(num_boxes + max_detections); std::vector sorted_values; sorted_values.resize(max_detections);