{"record":{"id":"5f5acfc86484da87","repo":"tensorflow/models","slug":"unrecognized-input-type-5f5acf","errorCode":null,"errorMessage":"Unrecognized `input_type`","messagePattern":"Unrecognized `input_type`","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/serving/export_utils.py","lineNumber":53,"sourceCode":"    input_name: A `str` to set the input image name in the signature, if None,\n      a default name `inputs` will be used.\n  Returns:\n    tf.TensorSpec of the input tensor.\n  \"\"\"\n  if input_type == 'image_tensor':\n    input_signature = tf.TensorSpec(\n        shape=[batch_size] + [None] * len(input_image_size) + [num_channels],\n        dtype=tf.uint8, name=input_name)\n  elif input_type in ['image_bytes', 'serve_examples', 'tf_example']:\n    input_signature = tf.TensorSpec(\n        shape=[batch_size], dtype=tf.string, name=input_name)\n  elif input_type == 'tflite':\n    input_signature = tf.TensorSpec(\n        shape=[1] + input_image_size + [num_channels],\n        dtype=tf.float32,\n        name=input_name)\n  else:\n    raise ValueError('Unrecognized `input_type`')\n  return input_signature\n\n\ndef decode_image(encoded_image_bytes: str,\n                 input_image_size: List[int],\n                 num_channels: int = 3,) -> tf.Tensor:\n  \"\"\"Decodes an image bytes to an image tensor.\n\n  Use `tf.image.decode_image` to decode an image if input is expected to be 2D\n  image; otherwise use `tf.io.decode_raw` to convert the raw bytes to tensor\n  and reshape it to desire shape.\n\n  Args:\n    encoded_image_bytes: An encoded image string to be decoded.\n    input_image_size: List[int] for the desired input size. This will be used to\n      infer whether the image is 2d or 3d.\n    num_channels: `int` for number of image channels.\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/serving/export_utils.py#L35-L71","documentation":"Error \"Unrecognized `input_type`\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/serving/export_utils.py:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set input_type to 'image_tensor', 'image_bytes', or 'tf_example'.","Check the serving input_type config for typos."],"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"}