{"record":{"id":"2e7119595b19ce82","repo":"tensorflow/models","slug":"input-boxlist-must-have-scores-field","errorCode":null,"errorMessage":"input boxlist must have 'scores' field","messagePattern":"input boxlist must have 'scores' field","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/box_list_ops.py","lineNumber":755,"sourceCode":"  Args:\n    boxlist: BoxList holding N boxes.  Must contain a 'scores' field\n      representing detection scores.\n    thresh: scalar threshold\n    max_output_size: maximum number of retained boxes\n    scope: name scope.\n\n  Returns:\n    a BoxList holding M boxes where M <= max_output_size\n  Raises:\n    ValueError: if thresh is not in [0, 1]\n  \"\"\"\n  with tf.name_scope(scope or 'NonMaxSuppression'):\n    if not 0 <= thresh <= 1.0:\n      raise ValueError('thresh must be between 0 and 1')\n    if not isinstance(boxlist, box_list.BoxList):\n      raise ValueError('boxlist must be a BoxList')\n    if not boxlist.has_field('scores'):\n      raise ValueError('input boxlist must have \\'scores\\' field')\n    selected_indices = tf.image.non_max_suppression(\n        boxlist.get(),\n        boxlist.get_field('scores'),\n        max_output_size,\n        iou_threshold=thresh)\n    return gather(boxlist, selected_indices)\n\n\ndef _copy_extra_fields(boxlist_to_copy_to, boxlist_to_copy_from):\n  \"\"\"Copies the extra fields of boxlist_to_copy_from to boxlist_to_copy_to.\n\n  Args:\n    boxlist_to_copy_to: BoxList to which extra fields are copied.\n    boxlist_to_copy_from: BoxList from which fields are copied.\n\n  Returns:\n    boxlist_to_copy_to with extra fields.\n  \"\"\"","sourceCodeStart":737,"sourceCodeEnd":773,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/box_list_ops.py#L737-L773","documentation":"Error \"input boxlist must have 'scores' field\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/box_list_ops.py:755 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a 'scores' field to the boxlist before pruning.","Call boxlist.add_field('scores', scores) with the detection scores."],"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"}