{"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":"Dispatch guard in create_evaluator: the attribute head count selects a 2D evaluator (1 head, heading only) or a 3D evaluator (3 heads); any other count has no evaluator mapping and raises this ValueError.","triggerScenarios":"Thrown at official/projects/pointpillars/utils/wod_detection_evaluator.py:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure exactly 1 attribute head for 2D evaluation or 3 for 3D evaluation","Align model_config.head.attribute_heads with the intended WOD evaluation mode","Fix a config merge that produced an unexpected head count"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}