{"record":{"id":"47b61822f071cb7f","repo":"opendatalab/MinerU","slug":"is-not-existed-47b618","errorCode":null,"errorMessage":"{} is not existed.","messagePattern":"(.+?) is not existed\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"mineru/model/utils/tools/infer/pytorchocr_utility.py","lineNumber":157,"sourceCode":"\n    parser.add_argument(\"--benchmark\", type=str2bool, default=False)\n    parser.add_argument(\"--save_log_path\", type=str, default=\"./log_output/\")\n\n    parser.add_argument(\"--show_log\", type=str2bool, default=True)\n\n    return parser\n\ndef parse_args():\n    parser = init_args()\n    return parser.parse_args()\n\ndef get_default_config(args):\n    return vars(args)\n\n\ndef read_network_config_from_yaml(yaml_path, char_num=None):\n    if not os.path.exists(yaml_path):\n        raise FileNotFoundError('{} is not existed.'.format(yaml_path))\n    import yaml\n    with open(yaml_path, encoding='utf-8') as f:\n        res = yaml.safe_load(f)\n    if res.get('Architecture') is None:\n        raise ValueError('{} has no Architecture'.format(yaml_path))\n    if res['Architecture']['Head']['name'] == 'MultiHead' and char_num is not None:\n        res['Architecture']['Head']['out_channels_list'] = {\n            'CTCLabelDecode': char_num,\n            'SARLabelDecode': char_num + 2,\n            'NRTRLabelDecode': char_num + 3\n        }\n    return res['Architecture']\n\ndef AnalysisConfig(weights_path, yaml_path=None, char_num=None):\n    if not os.path.exists(os.path.abspath(weights_path)):\n        raise FileNotFoundError('{} is not found.'.format(weights_path))\n\n    if yaml_path is not None:","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/opendatalab/MinerU/blob/4fe4bde114a23ee5dd637eae99b767f4669bf58c/mineru/model/utils/tools/infer/pytorchocr_utility.py#L139-L175","documentation":"Raised by read_network_config_from_yaml in pytorchocr_utility.py when the given YAML config path does not exist on disk. The function then opens the file to parse the network Architecture, so it checks existence first and reports the exact path.","triggerScenarios":"Calling the pytorchocr CLI/tools with --config pointing to a missing .yml; a path assembled from a model dir that was never downloaded; wrong working directory with relative paths.","commonSituations":"Running inference tools from a different cwd so relative config paths break; models not downloaded yet; typo in the config filename.","solutions":["Check the path: ls <yaml_path>; prefer absolute paths.","Re-download the model bundle (which includes the YAML) via mineru's model download tooling.","Pass yaml_path=None where the tool can fall back to analyzing the weights filename."],"exampleFix":"# before\npython pytorchocr/utility.py ... --config configs/rec_v6.yml  # missing file\n\n# after\nimport os\ncfg = os.path.abspath(\"configs/rec_v6.yml\")\nassert os.path.exists(cfg), cfg","handlingStrategy":"validation","validationCode":"import os\nyaml_path = os.path.abspath(yaml_path)\nif not os.path.isfile(yaml_path):\n    raise FileNotFoundError(f\"config yaml not found: {yaml_path}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve config paths to absolute at CLI parse time","Ship configs alongside weights in the model bundle"],"tags":["ocr","config","yaml","file-not-found"],"backgroundTag":null,"analyzedSha":"4fe4bde114a23ee5dd637eae99b767f4669bf58c","analyzedAt":"2026-08-14T21:29:18.456Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}