{"record":{"id":"552e083a904e4f04","repo":"tensorflow/models","slug":"skip-build-head-type-s","errorCode":null,"errorMessage":"Skip build head type: %s","messagePattern":"Skip build head type: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"official/projects/yt8m/modeling/yt8m_model.py","lineNumber":112,"sourceCode":"    self.backbone = backbone\n    self.build_head()\n\n  def build_head(self):\n    logging.info(\"Build DbofModel with %s.\", self._params.head.type)\n    head_cfg = self._params.head.get()\n    if self._params.head.type == \"moe\":\n      normalizer_params = dict(\n          synchronized=self._params.norm_activation.use_sync_bn,\n          momentum=self._params.norm_activation.norm_momentum,\n          epsilon=self._params.norm_activation.norm_epsilon,\n      )\n      aggregation_head = functools.partial(\n          heads.MoeModel, normalizer_params=normalizer_params\n      )\n    elif self._params.head.type == \"logistic\":\n      aggregation_head = heads.LogisticModel\n    else:\n      logging.warn(\"Skip build head type: %s\", self._params.head.type)\n      return\n\n    l2_regularizer = (\n        tf_keras.regularizers.l2(self._l2_weight_decay / 2.0)\n        if self._l2_weight_decay\n        else None\n    )\n    self.head = aggregation_head(\n        vocab_size=self._num_classes,\n        l2_regularizer=l2_regularizer,\n        **head_cfg.as_dict(),\n    )\n\n  def get_config(self):\n    return self._config_dict\n\n  @classmethod\n  def from_config(cls, config):  # pyrefly: ignore[bad-override]","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/yt8m/modeling/yt8m_model.py#L94-L130","documentation":"Error \"Skip build head type: %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/yt8m/modeling/yt8m_model.py:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set params.head.type to a supported aggregation head: moe (Mixture of Experts) or logistic.","If a custom head type was intended, extend build_head() to construct it; otherwise the model is built without an aggregation head."],"exampleFix":"# In the YT8M model config:\nhead:\n  type: moe   # or logistic","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"}