{"record":{"id":"81ea7c34dfac2bd2","repo":"opendatalab/MinerU","slug":"model-path-does-not-exists","errorCode":null,"errorMessage":"{model_path} does not exists.","messagePattern":"(.+?) does not exists\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"mineru/model/table/rec/slanet_plus/table_structure_utils.py","lineNumber":106,"sourceCode":"\n    def get_character_list(self, key: str = \"character\") -> List[str]:\n        meta_dict = self.session.get_modelmeta().custom_metadata_map\n        return meta_dict[key].splitlines()\n\n    def have_key(self, key: str = \"character\") -> bool:\n        meta_dict = self.session.get_modelmeta().custom_metadata_map\n        if key in meta_dict.keys():\n            return True\n        return False\n\n    @staticmethod\n    def _verify_model(model_path: Union[str, Path, None]):\n        if model_path is None:\n            raise ValueError(\"model_path is None!\")\n\n        model_path = Path(model_path)\n        if not model_path.exists():\n            raise FileNotFoundError(f\"{model_path} does not exists.\")\n\n        if not model_path.is_file():\n            raise FileExistsError(f\"{model_path} is not a file.\")\n\n\nclass ONNXRuntimeError(Exception):\n    pass\n\n\nclass TableLabelDecode:\n    def __init__(self, dict_character, merge_no_span_structure=True, **kwargs):\n        if merge_no_span_structure:\n            if \"<td></td>\" not in dict_character:\n                dict_character.append(\"<td></td>\")\n            if \"<td>\" in dict_character:\n                dict_character.remove(\"<td>\")\n\n        dict_character = self.add_special_char(dict_character)","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/model/table/rec/slanet_plus/table_structure_utils.py#L88-L124","documentation":"_verify_model checks the ONNX table-structure model path before loading: model_path must not be None (ValueError), must exist on disk (FileNotFoundError), and must be a regular file. The model file is normally auto-downloaded into the model root, so a missing file means the download step was skipped, failed, or the path is misconfigured.","triggerScenarios":"Constructing SLANet-plus table recognition with a custom model_path pointing at a nonexistent location, or when the auto-download of ModelPath.slane_plus failed (offline, no write permission, interrupted).","commonSituations":"Offline/air-gapped deployments where the model was never cached, models_root env var pointing to a read-only or wrong directory, typos in a user-supplied path.","solutions":["Re-run the auto-download (or run once online) so the model lands in the configured model root.","Verify the path: ls <model_root>/<model_file> and fix models_root / the passed model_path.","If deploying offline, pre-copy the .onnx file into the image at the expected path.","Check write permissions on the model root directory."],"exampleFix":"# before\neng = TableRecognition(model_path='/opt/models/slanet.onnx')  # missing\n\n# after\nfrom mineru.utils.models_download_utils import auto_download_and_get_model_root_path\nroot = auto_download_and_get_model_root_path('slanet_plus')\neng = TableRecognition(model_path=Path(root) / 'slanet_plus.onnx')","handlingStrategy":"validation","validationCode":"p = Path(model_path) if model_path else None\nif p is None or not p.is_file():\n    raise FileNotFoundError(f'run model download first; expected {p}')","typeGuard":"def is_valid_model_file(p) -> bool:\n    return p is not None and Path(p).is_file()","tryCatchPattern":"try:\n    eng = TableRecognition(model_path=p)\nexcept FileNotFoundError as e:\n    if 'does not exists' in str(e):\n        auto_download_and_get_model_root_path('slanet_plus')  # fetch then retry once\n        eng = TableRecognition(model_path=p)\n    else:\n        raise","preventionTips":["Pre-download models in the Docker build stage for offline deploys.","Verify model files with an init-time health check.","Make models_root explicit via env var and check write access."],"tags":["model-loading","onnx","table-recognition","deployment"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}