opendatalab/MinerU · critical · FileNotFoundError
{} is not existed.
Error message
{} is not existed. What it means
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.
Source
Thrown at mineru/model/utils/tools/infer/pytorchocr_utility.py:157
parser.add_argument("--benchmark", type=str2bool, default=False)
parser.add_argument("--save_log_path", type=str, default="./log_output/")
parser.add_argument("--show_log", type=str2bool, default=True)
return parser
def parse_args():
parser = init_args()
return parser.parse_args()
def get_default_config(args):
return vars(args)
def read_network_config_from_yaml(yaml_path, char_num=None):
if not os.path.exists(yaml_path):
raise FileNotFoundError('{} is not existed.'.format(yaml_path))
import yaml
with open(yaml_path, encoding='utf-8') as f:
res = yaml.safe_load(f)
if res.get('Architecture') is None:
raise ValueError('{} has no Architecture'.format(yaml_path))
if res['Architecture']['Head']['name'] == 'MultiHead' and char_num is not None:
res['Architecture']['Head']['out_channels_list'] = {
'CTCLabelDecode': char_num,
'SARLabelDecode': char_num + 2,
'NRTRLabelDecode': char_num + 3
}
return res['Architecture']
def AnalysisConfig(weights_path, yaml_path=None, char_num=None):
if not os.path.exists(os.path.abspath(weights_path)):
raise FileNotFoundError('{} is not found.'.format(weights_path))
if yaml_path is not None:View on GitHub (pinned to 4fe4bde114)
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.
Example fix
# before
python pytorchocr/utility.py ... --config configs/rec_v6.yml # missing file
# after
import os
cfg = os.path.abspath("configs/rec_v6.yml")
assert os.path.exists(cfg), cfg Defensive patterns
Strategy: validation
Validate before calling
import os
yaml_path = os.path.abspath(yaml_path)
if not os.path.isfile(yaml_path):
raise FileNotFoundError(f"config yaml not found: {yaml_path}") Prevention
- Resolve config paths to absolute at CLI parse time
- Ship configs alongside weights in the model bundle
When it happens
Trigger: 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.
Common situations: Running inference tools from a different cwd so relative config paths break; models not downloaded yet; typo in the config filename.
Related errors
- {} has no Architecture
- {} is not existed.
- not support limit type, image
- mode[{model_name}_model] is not implemented!
- mode[{model_name}_model] is not implemented!
AI-assisted analysis of opendatalab/MinerU@4fe4bde114 (2026-08-14).
Data as JSON: /api/errors/47b61822f071cb7f.
Report an issue: GitHub.