{"record":{"id":"81bca46f3c3942f1","repo":"tensorflow/models","slug":"can-only-use-image-and-boxes-input-for-deepmaskrcn","errorCode":null,"errorMessage":"Can only use image and boxes input for DeepMaskRCNNModel, Found {}","messagePattern":"Can only use image and boxes input for DeepMaskRCNNModel, Found (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/deepmac_maskrcnn/serving/detection.py","lineNumber":93,"sourceCode":"\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.\n    \"\"\"\n\n    if not isinstance(self.model, maskrcnn_model.DeepMaskRCNNModel):\n      raise ValueError(\n          ('Can only use image and boxes input for DeepMaskRCNNModel, '\n           'Found {}'.format(type(self.model))))\n\n    return self.serve_image_and_boxes(images, boxes)\n\n  def serve_image_and_boxes(self, images: tf.Tensor, boxes: tf.Tensor):\n    \"\"\"Function used to export a model that consumes and image and boxes.\n\n    The model predicts the class-agnostic masks at the given box locations.\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]","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/deepmac_maskrcnn/serving/detection.py#L75-L111","documentation":"Error \"Can only use image and boxes input for DeepMaskRCNNModel, Found {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/deepmac_maskrcnn/serving/detection.py:93 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"}