{"record":{"id":"0ffffe7e03ad930f","repo":"PaddlePaddle/PaddleOCR","slug":"model-name-is-not-supported-please-check-if-the-0ffffe","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_det.py","lineNumber":48,"sourceCode":"from ppocr.utils.utility import get_image_file_list, check_and_read\nfrom ppocr.data import create_operators, transform\nfrom ppocr.postprocess import build_post_process\nimport json\n\n\nclass TextDetector(object):\n    def __init__(self, args, logger=None):\n        if os.path.exists(f\"{args.det_model_dir}/inference.yml\"):\n            model_config = utility.load_config(f\"{args.det_model_dir}/inference.yml\")\n            model_name = model_config.get(\"Global\", {}).get(\"model_name\", \"\")\n            if model_name and model_name not in [\n                \"PP-OCRv5_mobile_det\",\n                \"PP-OCRv5_server_det\",\n                \"PP-OCRv6_tiny_det\",\n                \"PP-OCRv6_small_det\",\n                \"PP-OCRv6_medium_det\",\n            ]:\n                raise ValueError(\n                    f\"{model_name} is not supported. Please check if the model is supported by the PaddleOCR wheel.\"\n                )\n\n        if logger is None:\n            logger = get_logger()\n        self.args = args\n        self.det_algorithm = args.det_algorithm\n        self.use_onnx = args.use_onnx\n        pre_process_list = [\n            {\n                \"DetResizeForTest\": {\n                    \"limit_side_len\": args.det_limit_side_len,\n                    \"limit_type\": args.det_limit_type,\n                }\n            },\n            {\n                \"NormalizeImage\": {\n                    \"std\": [0.229, 0.224, 0.225],","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/tools/infer/predict_det.py#L30-L66","documentation":"TextDetector (tools/infer/predict_det.py) reads inference.yml from the detection model directory and rejects models whose Global.model_name is not in the wheel whitelist: PP-OCRv5/v6 mobile, server, tiny, small, medium det models. The gate only fires when inference.yml exists; models shipped without it (the traditional tar balls from the model zoo) are not checked. Its purpose is to stop users from using unsupported det models with the pip wheel, where preprocessing is hard-wired to the supported architectures.","triggerScenarios":"Setting --det_model_dir to a DB/PP-OCRv4/EAST/advanced det model that ships an inference.yml with a non-whitelisted model_name (e.g. 'PP-OCRv4_mobile_det', 'det_mv3_db').","commonSituations":"Migrating an old project that used PP-OCRv3/v4 det models to the new wheel; downloading 'latest' det models whose metadata names differ from the whitelist; fine-tuned det models re-exported with their original model_name.","solutions":["Use a whitelisted model: PP-OCRv5_mobile_det, PP-OCRv5_server_det, PP-OCRv6_tiny/small/medium_det","For older models, download the classic zoo packages that lack inference.yml (gate is skipped)","Only if the architecture truly matches, rename Global.model_name inside the model's inference.yml to a whitelisted entry","Build PaddleOCR from source instead of the wheel if you must run non-whitelisted det models"],"exampleFix":"# before\n--det_model_dir=./inference/PP-OCRv4_mobile_det  # ValueError\n\n# after\n--det_model_dir=./inference/PP-OCRv5_mobile_det","handlingStrategy":"validation","validationCode":"import os, yaml\nSUPPORTED_DET = {'PP-OCRv5_mobile_det','PP-OCRv5_server_det','PP-OCRv6_tiny_det','PP-OCRv6_small_det','PP-OCRv6_medium_det'}\nyml = os.path.join(det_model_dir, 'inference.yml')\nif os.path.exists(yml):\n    name = yaml.safe_load(open(yml)).get('Global', {}).get('model_name', '')\n    assert not name or name in SUPPORTED_DET, f'det model {name!r} unsupported'","typeGuard":null,"tryCatchPattern":"try:\n    det = TextDetector(args)\nexcept ValueError as e:\n    if 'not supported' in str(e):\n        raise SystemExit('use a PP-OCRv5/v6 det model or a legacy package without inference.yml')\n    raise","preventionTips":["Smoke-test model loading in CI with the exact model dirs used in production","When upgrading the PaddleOCR wheel, re-check the supported model list in the changelog"],"tags":["model-compatibility","whitelist","detection","wheel"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}