{"record":{"id":"f609df6b327e6ae0","repo":"tensorflow/models","slug":"attribute-type-head-type-not-supported","errorCode":null,"errorMessage":"Attribute type {head.type} not supported.","messagePattern":"Attribute type (.+?) not supported\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/pointpillars/tasks/pointpillars.py","lineNumber":182,"sourceCode":"    dataset = reader.read(input_context=input_context)\n\n    return dataset\n\n  def compute_attribute_losses(\n      self,\n      outputs: Mapping[str, Any],\n      labels: Mapping[str, Any],\n      box_sample_weight: tf.Tensor) -> Mapping[str, float]:\n    \"\"\"Computes attribute loss.\"\"\"\n    att_loss_fn = tf_keras.losses.Huber(\n        self.task_config.losses.huber_loss_delta,\n        reduction=tf_keras.losses.Reduction.SUM)\n\n    losses = {}\n    total_loss = 0.0\n    for head in self._attribute_heads:\n      if head.type != 'regression':\n        raise ValueError(f'Attribute type {head.type} not supported.')\n\n      y_true_att = loss_utils.multi_level_flatten(\n          labels['attribute_targets'][head.name], last_dim=head.size)\n      y_pred_att = loss_utils.multi_level_flatten(\n          outputs['attribute_outputs'][head.name], last_dim=head.size)\n      if head.name == 'heading':\n        # Direction aware loss, wrap the delta angle to [-pi, pi].\n        # Otherwise for a loss that is symmetric to direction (i.e., heading 0\n        # and pi are the same), we use a tf.sin transform.\n        delta = utils.wrap_angle_rad(y_pred_att - y_true_att)\n        loss = att_loss_fn(\n            y_true=tf.zeros_like(delta),\n            y_pred=delta,\n            sample_weight=box_sample_weight)\n      else:\n        loss = att_loss_fn(\n            y_true=y_true_att,\n            y_pred=y_pred_att,","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/pointpillars/tasks/pointpillars.py#L164-L200","documentation":"Error \"Attribute type {head.type} not supported.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/pointpillars/tasks/pointpillars.py:182 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"}