{"record":{"id":"f6c5516cc48cdd2a","repo":"tensorflow/models","slug":"match-results-should-have-rank-1","errorCode":null,"errorMessage":"match_results should have rank 1","messagePattern":"match_results should have rank 1","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/matcher.py","lineNumber":60,"sourceCode":"  This class is used to store the results from the matcher. It provides\n  convenient methods to query the matching results.\n  \"\"\"\n\n  def __init__(self, match_results):\n    \"\"\"Constructs a Match object.\n\n    Args:\n      match_results: Integer tensor of shape [N] with (1) match_results[i]>=0,\n        meaning that column i is matched with row match_results[i]. (2)\n        match_results[i]=-1, meaning that column i is not matched. (3)\n        match_results[i]=-2, meaning that column i is ignored.\n\n    Raises:\n      ValueError: if match_results does not have rank 1 or is not an\n        integer int32 scalar tensor\n    \"\"\"\n    if match_results.shape.ndims != 1:\n      raise ValueError('match_results should have rank 1')\n    if match_results.dtype != tf.int32:\n      raise ValueError('match_results should be an int32 or int64 scalar '\n                       'tensor')\n    self._match_results = match_results\n\n  @property\n  def match_results(self):\n    \"\"\"The accessor for match results.\n\n    Returns:\n      the tensor which encodes the match results.\n    \"\"\"\n    return self._match_results\n\n  def matched_column_indices(self):\n    \"\"\"Returns column indices that match to some row.\n\n    The indices returned by this op are always sorted in increasing order.","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/matcher.py#L42-L78","documentation":"Error \"match_results should have rank 1\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/matcher.py:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass match_results as a rank-1 tensor.","Flatten the match results to shape [num_rows]."],"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"}