{"record":{"id":"0b2c9f505915a568","repo":"PaddlePaddle/PaddleOCR","slug":"unknown-augmenter-arg","errorCode":null,"errorMessage":"Unknown augmenter arg: {}","messagePattern":"Unknown augmenter arg: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"ppocr/data/imaug/iaa_augment.py","lineNumber":130,"sourceCode":"            # Process individual transformation specified as dictionary\n            augmenter_type = args[\"type\"]\n            augmenter_args = args.get(\"args\", {})\n            augmenter_args_mapped = self.map_arguments(augmenter_type, augmenter_args)\n            augmenter_type_mapped = self.imgaug_to_albu.get(\n                augmenter_type, augmenter_type\n            )\n            if augmenter_type_mapped == \"Resize\":\n                return ImgaugLikeResize(**augmenter_args_mapped)\n            else:\n                cls = getattr(A, augmenter_type_mapped)\n                return cls(\n                    **{\n                        k: self.to_tuple_if_list(v)\n                        for k, v in augmenter_args_mapped.items()\n                    }\n                )\n        else:\n            raise RuntimeError(\"Unknown augmenter arg: \" + str(args))\n\n    # Map arguments to expected format for each augmenter type\n    def map_arguments(self, augmenter_type, augmenter_args):\n        augmenter_args = augmenter_args.copy()  # Avoid modifying the original arguments\n        if augmenter_type == \"Resize\":\n            # Ensure size is a valid 2-element list or tuple\n            size = augmenter_args.get(\"size\")\n            if size:\n                if not isinstance(size, (list, tuple)) or len(size) != 2:\n                    raise ValueError(\n                        f\"'size' must be a list or tuple of two numbers, but got {size}\"\n                    )\n                min_scale, max_scale = size\n                return {\n                    \"scale_range\": (min_scale, max_scale),\n                    \"interpolation\": 1,  # Linear interpolation\n                    \"p\": 1.0,\n                }","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/data/imaug/iaa_augment.py#L112-L148","documentation":"IAA (imgaug) augmenter construction in PaddleOCR maps each entry of the 'augmenter_args' list to an imgaug class via getattr(A, type). When the augmenter type string is not a recognized imgaug/Resize augmenter name, construction falls through and raises RuntimeError('Unknown augmenter arg: ' + str(args)).","triggerScenarios":"Using the iaa_augment.IaaAugment pipeline with an augmenter_args entry whose 'type' key is misspelled (e.g. 'Fliplr' vs 'Fliplr', 'Affine', 'Resize') or names a class that does not exist in the imgaug library version installed (A here is the imgaug augmenters module or its shim).","commonSituations":"Custom yml configs that add imgaug augmenters not covered by the mapping table; upgrading/downgrading imgaug so a class name disappears; a typo in the type field such as 'Resise' or 'MotionBlur' (imgaug has no such class).","solutions":["Check the exact spelling of the 'type' field against imgaug's augmenters module (python -c 'import imgaug.augmenters as A; print([n for n in dir(A) if n[0].isupper()])')","Use the supported special-case name 'Resize' for resize operations","Pin a compatible imgaug version (imgaug 0.4.0 is the usual requirement for PaddleOCR)","Print the args dict in the error and compare it field-by-field with a known-good config such as configs/det/det_db_iaa.yml style pipelines"],"exampleFix":"# before (config)\naugmenter_args:\n- { type: Fliplr, args: { p: 0.5 } }\n- { type: Resise, args: { size: [640, 640] } }\n# after\naugmenter_args:\n- { type: Fliplr, args: { p: 0.5 } }\n- { type: Resize, args: { size: [640, 640] } }","handlingStrategy":"validation","validationCode":"import imgaug.augmenters as A\nvalid = set(n for n in dir(A) if n[0].isupper()) | {'Resize'}\nfor entry in augmenter_args:\n    if entry['type'] not in valid:\n        raise SystemExit(f\"Unknown augmenter type {entry['type']}; valid: {sorted(valid)[:20]}...\")","typeGuard":null,"tryCatchPattern":"try:\n    aug = IaaAugment(augmenter_args=augmenter_args)\nexcept (RuntimeError, AttributeError, ValueError) as e:\n    raise ValueError(f'Bad iaa augmenter_args {augmenter_args}: {e}') from e","preventionTips":["List available imgaug augmenters at env-setup time and store them with your config","Pin imgaug==0.4.0 to keep the class set stable","Add new augmenter types one at a time, running one dataloader batch to catch constructor errors"],"tags":["config","imgaug","augmentation","typo"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}