{"record":{"id":"322ac309ade81086","repo":"tensorflow/models","slug":"len-indicators-must-be-len-thresholds-1-g","errorCode":null,"errorMessage":"len(`indicators`) must be len(`thresholds`) + 1, got indicators {}, thresholds {}","messagePattern":"len\\(`indicators`\\) must be len\\(`thresholds`\\) \\+ 1, got indicators (.+?), thresholds (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/ops/box_matcher.py","lineNumber":72,"sourceCode":"        types (e.g. positive or negative or ignored match). The list needs to be\n        sorted, and will be prepended with -Inf and appended with +Inf.\n      indicators: A list of values representing match types (e.g. positive or\n        negative or ignored match). len(`indicators`) must equal to\n        len(`thresholds`) + 1.\n      force_match_for_each_col: If True, ensures that each column is matched to\n        at least one row (which is not guaranteed otherwise if the\n        positive_threshold is high). Defaults to False. If True, all force\n        matched row will be assigned to `indicators[-1]`.\n\n    Raises:\n      ValueError: If `threshold` not sorted,\n        or len(indicators) != len(threshold) + 1\n    \"\"\"\n    if not all([lo <= hi for (lo, hi) in zip(thresholds[:-1], thresholds[1:])]):\n      raise ValueError('`threshold` must be sorted, got {}'.format(thresholds))\n    self.indicators = indicators\n    if len(indicators) != len(thresholds) + 1:\n      raise ValueError('len(`indicators`) must be len(`thresholds`) + 1, got '\n                       'indicators {}, thresholds {}'.format(\n                           indicators, thresholds))\n    thresholds = thresholds[:]\n    thresholds.insert(0, -float('inf'))\n    thresholds.append(float('inf'))\n    self.thresholds = thresholds\n    self._force_match_for_each_col = force_match_for_each_col\n\n  def __call__(self,\n               similarity_matrix: tf.Tensor) -> Tuple[tf.Tensor, tf.Tensor]:\n    \"\"\"Tries to match each column of the similarity matrix to a row.\n\n    Args:\n      similarity_matrix: A float tensor of shape [num_rows, num_cols] or\n        [batch_size, num_rows, num_cols] representing any similarity metric.\n\n    Returns:\n      matched_columns: An integer tensor of shape [num_rows] or [batch_size,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/ops/box_matcher.py#L54-L90","documentation":"Error \"len(`indicators`) must be len(`thresholds`) + 1, got indicators {}, thresholds {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/ops/box_matcher.py:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide exactly one more indicator than thresholds (len(indicators) == len(thresholds) + 1).","Add or remove entries in indicators to match the thresholds length."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}