{"record":{"id":"ba95c83ec4e6a134","repo":"tensorflow/models","slug":"saved-model-path-is-invalid","errorCode":null,"errorMessage":"Saved model path is invalid.","messagePattern":"Saved model path is invalid\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/tasks/image_classification.py","lineNumber":83,"sourceCode":"\ndef load_searched_model(saved_model_path: str) -> tf_keras.Model:\n  \"\"\"Loads saved model from file.\n\n  Excepting loading MobileNet-EdgeTPU-V1/V2 models, we can also load searched\n  model directly from saved model path by changing the model path in\n  mobilenet_edgetpu_search (defined in mobilenet_edgetpu_config.py)\n\n  Args:\n    saved_model_path: Directory path for the saved searched model.\n  Returns:\n    Loaded keras model.\n  \"\"\"\n  with tempfile.TemporaryDirectory() as tmp_dir:\n    if tf.io.gfile.isdir(saved_model_path):\n      _copy_recursively(saved_model_path, tmp_dir)\n      load_path = tmp_dir\n    else:\n      raise ValueError('Saved model path is invalid.')\n    load_options = tf.saved_model.LoadOptions(\n        experimental_io_device='/job:localhost')\n    model = tf_keras.models.load_model(load_path, options=load_options)\n\n  return model\n\n\n@task_factory.register_task_cls(edgetpu_cfg.MobilenetEdgeTPUTaskConfig)\nclass EdgeTPUTask(base_task.Task):\n  \"\"\"A task for training MobileNet-EdgeTPU models.\"\"\"\n\n  def build_model(self):\n    \"\"\"Builds model for MobileNet-EdgeTPU Task.\"\"\"\n    model_config = self.task_config.model\n    model_params = model_config.model_params.as_dict()\n    model_name = model_params['model_name']\n    registered_models = get_models()\n    if model_name in registered_models:","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/tasks/image_classification.py#L65-L101","documentation":"Error \"Saved model path is invalid.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/tasks/image_classification.py:83 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"}