{"record":{"id":"fe48cabdea8db802","repo":"tensorflow/models","slug":"match-results-should-be-an-int32-or-int64-scalar-t","errorCode":null,"errorMessage":"match_results should be an int32 or int64 scalar tensor","messagePattern":"match_results should be an int32 or int64 scalar tensor","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/matcher.py","lineNumber":62,"sourceCode":"  \"\"\"\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.\n\n    Returns:","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/matcher.py#L44-L80","documentation":"Error \"match_results should be an int32 or int64 scalar tensor\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/matcher.py:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass match_results as an int32 or int64 tensor.","Cast the match results with tf.cast(x, tf.int32)."],"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"}