{"record":{"id":"bf4e23b9ef00ce13","repo":"tensorflow/models","slug":"export-module-not-implemented-for-task-bf4e23","errorCode":null,"errorMessage":"Export module not implemented for {} task.","messagePattern":"Export module not implemented for (.+?) task\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/serving/export_tfhub_lib.py","lineNumber":56,"sourceCode":"      model. Default is False.\n\n  Returns:\n    A tf_keras.Model instance.\n\n  Raises:\n    ValueError: If the task is not supported.\n  \"\"\"\n  input_specs = tf_keras.layers.InputSpec(shape=[batch_size] +\n                                          input_image_size + [num_channels])\n  if isinstance(params.task,\n                configs.image_classification.ImageClassificationTask):\n    model = factory.build_classification_model(\n        input_specs=input_specs,\n        model_config=params.task.model,\n        l2_regularizer=None,\n        skip_logits_layer=skip_logits_layer)\n  else:\n    raise ValueError('Export module not implemented for {} task.'.format(\n        type(params.task)))\n  return model\n\n\ndef export_model_to_tfhub(batch_size: Optional[int],\n                          input_image_size: List[int],\n                          params: cfg.ExperimentConfig,\n                          checkpoint_path: str,\n                          export_path: str,\n                          num_channels: int = 3,\n                          skip_logits_layer: bool = False):\n  \"\"\"Export a TF2 model to TF-Hub.\"\"\"\n  model = build_model(batch_size, input_image_size, params, num_channels,\n                      skip_logits_layer)\n  checkpoint = tf.train.Checkpoint(model=model)\n  checkpoint.restore(checkpoint_path).assert_existing_objects_matched()\n  model.save(export_path, include_optimizer=False, save_format='tf')\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/serving/export_tfhub_lib.py#L38-L74","documentation":"Error \"Export module not implemented for {} task.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/serving/export_tfhub_lib.py:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported task for TF-Hub export (e.g. 'classification', 'detection', 'segmentation').","Register an export module for your custom task."],"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"}