{"record":{"id":"c559adc8bdde67fb","repo":"tensorflow/models","slug":"indices-should-be-an-int32-int64-tensor","errorCode":null,"errorMessage":"indices should be an int32 / int64 tensor","messagePattern":"indices should be an int32 / int64 tensor","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"official/projects/centernet/ops/box_list_ops.py","lineNumber":159,"sourceCode":"    fields: (optional) list of fields to also gather from.  If None (default),\n      all fields are gathered from.  Pass an empty fields list to only gather\n      the box coordinates.\n    use_static_shapes: Whether to use an implementation with static shape\n      gurantees.\n\n  Returns:\n    subboxlist: a BoxList corresponding to the subset of the input BoxList\n    specified by indices\n\n  Raises:\n    ValueError: if specified field is not contained in boxlist or if the\n      indices are not of type int32\n  \"\"\"\n  with tf.name_scope('Gather'):\n    if len(indices.shape.as_list()) != 1:\n      raise ValueError('indices should have rank 1')\n    if indices.dtype != tf.int32 and indices.dtype != tf.int64:\n      raise ValueError('indices should be an int32 / int64 tensor')\n    gather_op = tf.gather\n    if use_static_shapes:\n      gather_op = matmul_gather_on_zeroth_axis\n    subboxlist = box_list.BoxList(gather_op(boxlist.get(), indices))\n    if fields is None:\n      fields = boxlist.get_extra_fields()\n    fields += ['boxes']\n    for field in fields:\n      if not boxlist.has_field(field):\n        raise ValueError('boxlist must contain all specified fields')\n      subfieldlist = gather_op(boxlist.get_field(field), indices)\n      subboxlist.add_field(field, subfieldlist)\n    return subboxlist\n\n\ndef prune_completely_outside_window(boxlist, window):\n  \"\"\"Prunes bounding boxes that fall completely outside of the given window.\n","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/centernet/ops/box_list_ops.py#L141-L177","documentation":"Error \"indices should be an int32 / int64 tensor\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/centernet/ops/box_list_ops.py:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}