tensorflow/models · error · ValueError

Export module not implemented for {} task.

Error message

Export module not implemented for {} task.

What it means

Error "Export module not implemented for {} task." thrown in tensorflow/models.

Source

Thrown at official/vision/serving/export_tfhub_lib.py:56

      model. Default is False.

  Returns:
    A tf_keras.Model instance.

  Raises:
    ValueError: If the task is not supported.
  """
  input_specs = tf_keras.layers.InputSpec(shape=[batch_size] +
                                          input_image_size + [num_channels])
  if isinstance(params.task,
                configs.image_classification.ImageClassificationTask):
    model = factory.build_classification_model(
        input_specs=input_specs,
        model_config=params.task.model,
        l2_regularizer=None,
        skip_logits_layer=skip_logits_layer)
  else:
    raise ValueError('Export module not implemented for {} task.'.format(
        type(params.task)))
  return model


def export_model_to_tfhub(batch_size: Optional[int],
                          input_image_size: List[int],
                          params: cfg.ExperimentConfig,
                          checkpoint_path: str,
                          export_path: str,
                          num_channels: int = 3,
                          skip_logits_layer: bool = False):
  """Export a TF2 model to TF-Hub."""
  model = build_model(batch_size, input_image_size, params, num_channels,
                      skip_logits_layer)
  checkpoint = tf.train.Checkpoint(model=model)
  checkpoint.restore(checkpoint_path).assert_existing_objects_matched()
  model.save(export_path, include_optimizer=False, save_format='tf')

View on GitHub (pinned to e006f5f0d5)

Solutions

  1. Use a supported task for TF-Hub export (e.g. 'classification', 'detection', 'segmentation').
  2. Register an export module for your custom task.

When it happens

Trigger: Thrown at official/vision/serving/export_tfhub_lib.py:56 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/bf4e23b9ef00ce13. Report an issue: GitHub.