tensorflow/models · error
Skip build head type: %s
Error message
Skip build head type: %s
What it means
Error "Skip build head type: %s" thrown in tensorflow/models.
Source
Thrown at official/projects/yt8m/modeling/yt8m_model.py:112
self.backbone = backbone
self.build_head()
def build_head(self):
logging.info("Build DbofModel with %s.", self._params.head.type)
head_cfg = self._params.head.get()
if self._params.head.type == "moe":
normalizer_params = dict(
synchronized=self._params.norm_activation.use_sync_bn,
momentum=self._params.norm_activation.norm_momentum,
epsilon=self._params.norm_activation.norm_epsilon,
)
aggregation_head = functools.partial(
heads.MoeModel, normalizer_params=normalizer_params
)
elif self._params.head.type == "logistic":
aggregation_head = heads.LogisticModel
else:
logging.warn("Skip build head type: %s", self._params.head.type)
return
l2_regularizer = (
tf_keras.regularizers.l2(self._l2_weight_decay / 2.0)
if self._l2_weight_decay
else None
)
self.head = aggregation_head(
vocab_size=self._num_classes,
l2_regularizer=l2_regularizer,
**head_cfg.as_dict(),
)
def get_config(self):
return self._config_dict
@classmethod
def from_config(cls, config): # pyrefly: ignore[bad-override]View on GitHub (pinned to e006f5f0d5)
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.
Example fix
# In the YT8M model config: head: type: moe # or logistic
When it happens
Trigger: Thrown at official/projects/yt8m/modeling/yt8m_model.py:112 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24).
Data as JSON: /api/errors/552e083a904e4f04.
Report an issue: GitHub.