{"record":{"id":"5131e9364a3ba334","repo":"tensorflow/models","slug":"indices-should-have-rank-1","errorCode":null,"errorMessage":"indices should have rank 1","messagePattern":"indices should have rank 1","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"official/projects/centernet/ops/box_list_ops.py","lineNumber":157,"sourceCode":"    boxlist: BoxList holding N boxes\n    indices: a rank-1 tensor of type int32 / int64\n    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):","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/centernet/ops/box_list_ops.py#L139-L175","documentation":"Error \"indices should have rank 1\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/centernet/ops/box_list_ops.py:157 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"}