{"record":{"id":"65b8cb91b60007ce","repo":"huggingface/transformers","slug":"auto-class-is-not-a-valid-auto-class-65b8cb","errorCode":null,"errorMessage":"{auto_class} is not a valid auto class.","messagePattern":"(.+?) is not a valid auto class\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/image_processing_base.py","lineNumber":469,"sourceCode":"    @classmethod\n    def register_for_auto_class(cls, auto_class=\"AutoImageProcessor\"):\n        \"\"\"\n        Register this class with a given auto class. This should only be used for custom image processors as the ones\n        in the library are already mapped with `AutoImageProcessor `.\n\n\n\n        Args:\n            auto_class (`str` or `type`, *optional*, defaults to `\"AutoImageProcessor \"`):\n                The auto class to register this new image processor with.\n        \"\"\"\n        if not isinstance(auto_class, str):\n            auto_class = auto_class.__name__\n\n        import transformers.models.auto as auto_module\n\n        if not hasattr(auto_module, auto_class):\n            raise ValueError(f\"{auto_class} is not a valid auto class.\")\n\n        cls._auto_class = auto_class\n\n    def fetch_images(self, image_url_or_urls: str | list[str] | list[list[str]]):\n        \"\"\"\n        Convert a single or a list of urls into the corresponding `PIL.Image` objects.\n\n        If a single url is passed, the return value will be a single object. If a list is passed a list of objects is\n        returned.\n        \"\"\"\n        if isinstance(image_url_or_urls, (list, tuple)):\n            return [self.fetch_images(x) for x in image_url_or_urls]\n        elif isinstance(image_url_or_urls, str):\n            return load_image(image_url_or_urls)\n        elif is_valid_image(image_url_or_urls):\n            return image_url_or_urls\n        else:\n            raise TypeError(f\"only a single or a list of entries is supported but got type={type(image_url_or_urls)}\")","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/image_processing_base.py#L451-L487","documentation":"Error \"{auto_class} is not a valid auto class.\" thrown in huggingface/transformers.","triggerScenarios":"Raised in ImageProcessingMixin.from_dict/from_json auto-class resolution when auto_class is not a registered auto class name.","commonSituations":"Typo or unsupported value in the auto_class argument when loading an image processor generically.","solutions":["Use a valid auto class name such as 'AutoImageProcessor'.","Check the registered auto class names in the mapping."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}