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/projects/deepmac_maskrcnn/serving/detection.py:71
class DetectionModule(detection.DetectionModule):
"""Detection Module."""
def _build_model(self):
if self._batch_size is None:
ValueError("batch_size can't be None for detection models")
if self.params.task.model.detection_generator.nms_version != 'batched':
ValueError('Only batched_nms is supported.')
input_specs = tf_keras.layers.InputSpec(shape=[self._batch_size] +
self._input_image_size + [3])
if isinstance(self.params.task.model, cfg.DeepMaskHeadRCNN):
model = deep_mask_head_rcnn.build_maskrcnn(
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
@tf.function
def inference_for_tflite_image_and_boxes(
self, images: tf.Tensor, boxes: tf.Tensor) -> Mapping[str, tf.Tensor]:
"""A tf-function for serve_image_and_boxes.
Args:
images: A [batch_size, height, width, channels] float tensor.
boxes: A [batch_size, num_boxes, 4] float tensor containing boxes
normalized to the input image.
Returns:
result: A dict containing:
'detection_masks': A [batch_size, num_boxes, mask_height, mask_width]
float tensor containing per-pixel mask probabilities.View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/deepmac_maskrcnn/serving/detection.py:71 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/446e0331e682a04a.
Report an issue: GitHub.