{"record":{"id":"eb2ae9b19b261a00","repo":"tensorflow/models","slug":"the-length-of-attribute-heads-should-be-1-or-3-fo","errorCode":null,"errorMessage":"The length of attribute_heads should be 1 or 3, found {}","messagePattern":"The length of attribute_heads should be 1 or 3, found (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/pointpillars/utils/wod_detection_evaluator.py","lineNumber":307,"sourceCode":"    values.append(box2d[:, 0])  # center_x\n    values.append(box2d[:, 1])  # center_y\n    values.append(box2d[:, 2])  # length\n    values.append(box2d[:, 3])  # width\n    values.append(attributes['heading'][:, 0])  # heading\n    box2d_h = tf.stack(values, axis=-1)\n    return box2d_h\n\n\ndef create_evaluator(model_config: cfg.PointPillarsModel) -> _AbstractEvaluator:\n  \"\"\"Create either 2d or 3d evaluator.\"\"\"\n  attr_count = len(model_config.head.attribute_heads)\n  if attr_count == 1:\n    logging.info('Use 2D detection evaluator.')\n    return Wod2dDetectionEvaluator(model_config)\n  if attr_count == 3:\n    logging.info('Use 3D detection evaluator.')\n    return Wod3dDetectionEvaluator(model_config)\n  raise ValueError(\n      'The length of attribute_heads should be 1 or 3, found {}'.format(\n          attr_count))\n","sourceCodeStart":289,"sourceCodeEnd":310,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/pointpillars/utils/wod_detection_evaluator.py#L289-L310","documentation":"Error \"The length of attribute_heads should be 1 or 3, found {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/pointpillars/utils/wod_detection_evaluator.py:307 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"}