{"record":{"id":"5deaedbc18366501","repo":"tensorflow/models","slug":"instantiate-sub-task-models-is-not-implemented","errorCode":null,"errorMessage":"_instantiate_sub_task_models() is not implemented.","messagePattern":"_instantiate_sub_task_models\\(\\) is not implemented\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"official/modeling/multitask/base_model.py","lineNumber":35,"sourceCode":"\nimport tensorflow as tf, tf_keras\n\n\nclass MultiTaskBaseModel(tf.Module):\n  \"\"\"Base class that holds multi-task model computation.\"\"\"\n\n  def __init__(self, **kwargs):\n    super().__init__(**kwargs)\n    self._sub_tasks = self._instantiate_sub_tasks()\n\n  def _instantiate_sub_tasks(self) -> Dict[Text, tf_keras.Model]:\n    \"\"\"Abstract function that sets up the computation for each sub-task.\n\n    Returns:\n      A map from task name (as string) to a tf_keras.Model object that\n        represents the sub-task in the multi-task pool.\n    \"\"\"\n    raise NotImplementedError(\n        \"_instantiate_sub_task_models() is not implemented.\")\n\n  @property\n  def sub_tasks(self):\n    \"\"\"Fetch a map of task name (string) to task model (tf_keras.Model).\"\"\"\n    return self._sub_tasks\n\n  def initialize(self):\n    \"\"\"Optional function that loads a pre-train checkpoint.\"\"\"\n    return\n\n  def build(self):\n    \"\"\"Builds the networks for tasks to make sure variables are created.\"\"\"\n    # Try to build all sub tasks.\n    for task_model in self._sub_tasks.values():\n      # Assumes all the tf.Module models are built because we don't have any\n      # way to check them.\n      if isinstance(task_model, tf_keras.Model) and not task_model.built:","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/modeling/multitask/base_model.py#L17-L53","documentation":"Error \"_instantiate_sub_task_models() is not implemented.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/modeling/multitask/base_model.py:35 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"}