tensorflow/models · error · ValueError

Detection module not implemented for {} model.

Error message

Detection module not implemented for {} model.

What it means

Error "Detection module not implemented for {} model." thrown in tensorflow/models.

Source

Thrown at official/vision/serving/detection.py:70

          'does not support with dynamic batch size.',
          nms_version,
      )
      self.params.task.model.detection_generator.nms_version = 'batched'

    input_specs = tf_keras.layers.InputSpec(
        shape=[self._batch_size, *self._padded_size, 3]
    )

    if isinstance(self.params.task.model, configs.maskrcnn.MaskRCNN):
      model = factory.build_maskrcnn(
          input_specs=input_specs, model_config=self.params.task.model
      )
    elif isinstance(self.params.task.model, configs.retinanet.RetinaNet):
      model = factory.build_retinanet(
          input_specs=input_specs, model_config=self.params.task.model
      )
    else:
      raise ValueError(
          'Detection module not implemented for {} model.'.format(
              type(self.params.task.model)
          )
      )

    return model

  def _build_anchor_boxes(self):
    """Builds and returns anchor boxes."""
    model_params = self.params.task.model
    input_anchor = anchor.build_anchor_generator(
        min_level=model_params.min_level,
        max_level=model_params.max_level,
        num_scales=model_params.anchor.num_scales,
        aspect_ratios=model_params.anchor.aspect_ratios,
        anchor_size=model_params.anchor.anchor_size,
    )
    return input_anchor(image_size=self._padded_size)

View on GitHub (pinned to e006f5f0d5)

Solutions

  1. Use a supported detection model type for the serving module (e.g. RetinaNet or Mask R-CNN).
  2. Implement a DetectionModule subclass for your model or pick a supported one.

When it happens

Trigger: Thrown at official/vision/serving/detection.py:70 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/02c9c0679250da0e. Report an issue: GitHub.