{"record":{"id":"7c83058e78639e64","repo":"tensorflow/models","slug":"unmatched-threshold-needs-to-be-smaller-or-equalto","errorCode":null,"errorMessage":"unmatched_threshold needs to be smaller or equalto matched_threshold","messagePattern":"unmatched_threshold needs to be smaller or equalto matched_threshold","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/argmax_matcher.py","lineNumber":90,"sourceCode":"        and unmatched threshold, and everything lower than unmatched is ignored.\n      force_match_for_each_row: If True, ensures that each row is matched to\n        at least one column (which is not guaranteed otherwise if the\n        matched_threshold is high). Defaults to False. See\n        argmax_matcher_test.testMatcherForceMatch() for an example.\n\n    Raises:\n      ValueError: if unmatched_threshold is set but matched_threshold is not set\n        or if unmatched_threshold > matched_threshold.\n    \"\"\"\n    if (matched_threshold is None) and (unmatched_threshold is not None):\n      raise ValueError('Need to also define matched_threshold when'\n                       'unmatched_threshold is defined')\n    self._matched_threshold = matched_threshold\n    if unmatched_threshold is None:\n      self._unmatched_threshold = matched_threshold\n    else:\n      if unmatched_threshold > matched_threshold:\n        raise ValueError('unmatched_threshold needs to be smaller or equal'\n                         'to matched_threshold')\n      self._unmatched_threshold = unmatched_threshold\n    if not negatives_lower_than_unmatched:\n      if self._unmatched_threshold == self._matched_threshold:\n        raise ValueError('When negatives are in between matched and '\n                         'unmatched thresholds, these cannot be of equal '\n                         'value. matched: %s, unmatched: %s',\n                         self._matched_threshold, self._unmatched_threshold)\n    self._force_match_for_each_row = force_match_for_each_row\n    self._negatives_lower_than_unmatched = negatives_lower_than_unmatched\n\n  def _match(self, similarity_matrix):\n    \"\"\"Tries to match each column of the similarity matrix to a row.\n\n    Args:\n      similarity_matrix: tensor of shape [N, M] representing any similarity\n        metric.\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/argmax_matcher.py#L72-L108","documentation":"Error \"unmatched_threshold needs to be smaller or equalto matched_threshold\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/argmax_matcher.py:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set unmatched_threshold <= matched_threshold.","Swap or adjust the two thresholds so they are ordered correctly."],"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"}