{"record":{"id":"baebfe780c902fef","repo":"tensorflow/models","slug":"add-tpu-function-alias-is-only-allowed-for-input-t","errorCode":null,"errorMessage":"add_tpu_function_alias is only allowed for input_type of: image_tensor, image_bytes, tf_example.","messagePattern":"add_tpu_function_alias is only allowed for input_type of: image_tensor, image_bytes, tf_example\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/serving/export_saved_model_lib.py","lineNumber":157,"sourceCode":"          input_image_size=input_image_size,\n          input_type=input_type,\n          num_channels=num_channels,\n          input_name=input_name,\n      )\n    else:\n      raise ValueError(\n          'Export module not implemented for {} task.'.format(type(params.task))\n      )\n\n  if add_tpu_function_alias:\n    if input_type == 'image_tensor':\n      inference_func = export_module.inference_from_image_tensors\n    elif input_type == 'image_bytes':\n      inference_func = export_module.inference_from_image_bytes\n    elif input_type == 'tf_example':\n      inference_func = export_module.inference_from_tf_example\n    else:\n      raise ValueError(\n          'add_tpu_function_alias is only allowed for input_type of:'\n          ' image_tensor, image_bytes, tf_example.'\n      )\n    save_options = tf.saved_model.SaveOptions(\n        function_aliases={\n            'tpu_candidate': inference_func,\n        }\n    )\n\n  export_base.export(\n      export_module,\n      function_keys=function_keys if function_keys else [input_type],\n      export_savedmodel_dir=output_saved_model_directory,\n      checkpoint=checkpoint,\n      checkpoint_path=checkpoint_path,\n      timestamped=False,\n      save_options=save_options,\n  )","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/serving/export_saved_model_lib.py#L139-L175","documentation":"Error \"add_tpu_function_alias is only allowed for input_type of: image_tensor, image_bytes, tf_example.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/serving/export_saved_model_lib.py:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set input_type to 'image_tensor', 'image_bytes', or 'tf_example' when add_tpu_function_alias is enabled.","Disable add_tpu_function_alias for other input types."],"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"}