{"record":{"id":"4729d502f826c49f","repo":"PaddlePaddle/PaddleOCR","slug":"model-name-is-not-supported-please-check-if-the-4729d5","errorCode":null,"errorMessage":"{model_name} is not supported. Please check if the model is supported by the PaddleOCR wheel.","messagePattern":"(.+?) is not supported\\. Please check if the model is supported by the PaddleOCR wheel\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/infer/predict_sr.py","lineNumber":45,"sourceCode":"import time\nimport traceback\nimport paddle\n\nimport tools.infer.utility as utility\nfrom ppocr.postprocess import build_post_process\nfrom ppocr.utils.logging import get_logger\nfrom ppocr.utils.utility import get_image_file_list, check_and_read\n\nlogger = get_logger()\n\n\nclass TextSR(object):\n    def __init__(self, args):\n        if os.path.exists(f\"{args.sr_model_dir}/inference.yml\"):\n            model_config = utility.load_config(f\"{args.sr_model_dir}/inference.yml\")\n            model_name = model_config.get(\"Global\", {}).get(\"model_name\", \"\")\n            if model_name:\n                raise ValueError(\n                    f\"{model_name} is not supported. Please check if the model is supported by the PaddleOCR wheel.\"\n                )\n\n        self.sr_image_shape = [int(v) for v in args.sr_image_shape.split(\",\")]\n        self.sr_batch_num = args.sr_batch_num\n\n        (\n            self.predictor,\n            self.input_tensor,\n            self.output_tensors,\n            self.config,\n        ) = utility.create_predictor(args, \"sr\", logger)\n        self.benchmark = args.benchmark\n        if args.benchmark:\n            import auto_log\n\n            pid = os.getpid()\n            gpu_id = utility.get_infer_gpuid()","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/tools/infer/predict_sr.py#L27-L63","documentation":"TextSR (tools/infer/predict_sr.py), the text super-resolution predictor, reads inference.yml from the sr model directory and rejects any model declaring a Global.model_name — i.e. all models with new-style metadata. Like the e2e gate, this means the SR pipeline is not supported by the PaddleOCR wheel: the check exists to fail fast instead of producing subtly wrong super-resolution results.","triggerScenarios":"Running SR inference with --sr_model_dir pointing at a model directory containing an inference.yml with a non-empty Global.model_name.","commonSituations":"Repackaged SR models (e.g. TE_PGN/ch_PP-OCRv3) with added metadata; using the wheel but expecting legacy SR support; wrong flag pointing a modern model dir at --sr_model_dir.","solutions":["Use the legacy SR model packages from the model zoo that ship without inference.yml","Remove inference.yml from the model directory to bypass the gate (only for the original SR architectures)","Run SR from a PaddleOCR source checkout where the wheel restrictions do not apply"],"exampleFix":"# before\n--sr_model_dir=./inference/TE_PGN  # ValueError if inference.yml exists\n\n# after\nrm ./inference/TE_PGN/inference.yml\n# or unpack the original zoo tarball untouched","handlingStrategy":"validation","validationCode":"import os\nif os.path.exists(os.path.join(sr_model_dir, 'inference.yml')):\n    raise SystemExit('SR models with inference.yml are rejected by the wheel — use the legacy zoo package or remove the yml')","typeGuard":null,"tryCatchPattern":"try:\n    sr = TextSR(args)\nexcept ValueError as e:\n    if 'not supported' in str(e):\n        raise SystemExit('SR unsupported by wheel; run from source or drop SR from the pipeline')\n    raise","preventionTips":["Treat SR as optional in your pipeline so its absence degrades gracefully","Do not add inference.yml metadata when repackaging legacy SR models"],"tags":["model-compatibility","super-resolution","whitelist","wheel"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}