{"record":{"id":"446e0331e682a04a","repo":"tensorflow/models","slug":"detection-module-not-implemented-for-model","errorCode":null,"errorMessage":"Detection module not implemented for {} model.","messagePattern":"Detection module not implemented for (.+?) model\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/deepmac_maskrcnn/serving/detection.py","lineNumber":71,"sourceCode":"\n\nclass DetectionModule(detection.DetectionModule):\n  \"\"\"Detection Module.\"\"\"\n\n  def _build_model(self):\n\n    if self._batch_size is None:\n      ValueError(\"batch_size can't be None for detection models\")\n    if self.params.task.model.detection_generator.nms_version != 'batched':\n      ValueError('Only batched_nms is supported.')\n    input_specs = tf_keras.layers.InputSpec(shape=[self._batch_size] +\n                                            self._input_image_size + [3])\n\n    if isinstance(self.params.task.model, cfg.DeepMaskHeadRCNN):\n      model = deep_mask_head_rcnn.build_maskrcnn(\n          input_specs=input_specs, model_config=self.params.task.model)\n    else:\n      raise ValueError('Detection module not implemented for {} model.'.format(\n          type(self.params.task.model)))\n\n    return model\n\n  @tf.function\n  def inference_for_tflite_image_and_boxes(\n      self, images: tf.Tensor, boxes: tf.Tensor) -> Mapping[str, tf.Tensor]:\n    \"\"\"A tf-function for serve_image_and_boxes.\n\n    Args:\n      images: A [batch_size, height, width, channels] float tensor.\n      boxes: A [batch_size, num_boxes, 4] float tensor containing boxes\n        normalized to the input image.\n\n    Returns:\n      result: A dict containing:\n        'detection_masks': A [batch_size, num_boxes, mask_height, mask_width]\n          float tensor containing per-pixel mask probabilities.","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/deepmac_maskrcnn/serving/detection.py#L53-L89","documentation":"Error \"Detection module not implemented for {} model.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/deepmac_maskrcnn/serving/detection.py:71 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"}