{"record":{"id":"398a13f7f3779ea0","repo":"PaddlePaddle/PaddleOCR","slug":"invalid-ocr-version-ocr-version-supported-valu-398a13","errorCode":null,"errorMessage":"Invalid OCR version: {ocr_version}. Supported values are {_SUPPORTED_OCR_VERSIONS}.","messagePattern":"Invalid OCR version: (.+?)\\. Supported values are (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"paddleocr/_pipelines/pp_structurev3.py","lineNumber":104,"sourceCode":"        formula_recognition_model_name=None,\n        formula_recognition_model_dir=None,\n        formula_recognition_batch_size=None,\n        use_doc_orientation_classify=None,\n        use_doc_unwarping=None,\n        use_textline_orientation=None,\n        use_seal_recognition=None,\n        use_table_recognition=None,\n        use_formula_recognition=None,\n        use_chart_recognition=None,\n        use_region_detection=None,\n        format_block_content=None,\n        markdown_ignore_labels=None,\n        lang=None,\n        ocr_version=None,\n        **kwargs,\n    ):\n        if ocr_version is not None and ocr_version not in _SUPPORTED_OCR_VERSIONS:\n            raise ValueError(\n                f\"Invalid OCR version: {ocr_version}. Supported values are {_SUPPORTED_OCR_VERSIONS}.\"\n            )\n\n        if all(\n            map(\n                lambda p: p is None,\n                (\n                    text_detection_model_name,\n                    text_detection_model_dir,\n                    text_recognition_model_name,\n                    text_recognition_model_dir,\n                ),\n            )\n        ):\n            if lang is not None or ocr_version is not None:\n                det_model_name, rec_model_name = self._get_ocr_model_names(\n                    lang, ocr_version\n                )","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_pipelines/pp_structurev3.py#L86-L122","documentation":"PPStructureV3's constructor validates ocr_version against its own _SUPPORTED_OCR_VERSIONS list, which is ['PP-OCRv3','PP-OCRv4','PP-OCRv5'] — notably shorter than the PaddleOCR pipeline's list (which adds PP-OCRv6). Passing an unrecognized or PP-OCRv6 version here raises ValueError before models load.","triggerScenarios":"PPStructureV3(ocr_version='PP-OCRv6') (valid for PaddleOCR but NOT here), PPStructureV3(ocr_version='pp-ocrv4') (case-sensitive), or 'PP-OCRv2'.","commonSituations":"Sharing one config dict between PaddleOCR and PPStructureV3 pipelines; assuming all pipelines accept the same version list; copying PP-OCRv6 settings from OCR docs into a structure pipeline.","solutions":["Use 'PP-OCRv3', 'PP-OCRv4', or 'PP-OCRv5' (exact case), or omit ocr_version for the default.","If you specifically need PP-OCRv6 text models inside document parsing, pass them explicitly via text_detection_model_name / text_recognition_model_name instead of ocr_version.","Keep per-pipeline config instead of one shared ocr_version value."],"exampleFix":"# before\npipe = PPStructureV3(ocr_version='PP-OCRv6')  # ValueError in this pipeline\n# after\npipe = PPStructureV3(ocr_version='PP-OCRv5')","handlingStrategy":"validation","validationCode":"from paddleocr._pipelines.pp_structurev3 import _SUPPORTED_OCR_VERSIONS as STRUCT_VERS\n\ndef valid_struct_ocr_version(v) -> bool:\n    return v is None or v in STRUCT_VERS  # ['PP-OCRv3','PP-OCRv4','PP-OCRv5']","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not share one ocr_version value across pipelines; each validates its own list","PP-OCRv6 is rejected here even though PaddleOCR accepts it","Validate config against the specific pipeline module's constants"],"tags":["pp-structurev3","ocr-version","config","valueerror"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}