{"record":{"id":"bc804ed111d449e2","repo":"keras-team/keras","slug":"the-filters-argument-must-be-a-regex-string-a-l","errorCode":null,"errorMessage":"The `filters` argument must be a regex string, a list of regex strings, or a callable. Received: {type(filters)}","messagePattern":"The `filters` argument must be a regex string, a list of regex strings, or a callable\\. Received: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/models/model.py","lineNumber":576,"sourceCode":"                value_range=(-127, 127)\n            ),\n        )\n\n        # Quantize with custom config\n        model.quantize(config=config)\n        ```\n        \"\"\"\n        # Validate inputs.\n        type_check = kwargs.pop(\"type_check\", True)\n        if kwargs:\n            raise ValueError(\n                \"Unrecognized keyword arguments \"\n                f\"passed to {self.__class__.__name__}: {kwargs}\"\n            )\n\n        if filters is not None:\n            if not isinstance(filters, (str, Callable, list, tuple)):\n                raise ValueError(\n                    \"The `filters` argument must be a regex string, a list of \"\n                    \"regex strings, or a callable. Received: \"\n                    f\"{type(filters)}\"\n                )\n\n        # `mode` and `config` arrive here already resolved to a concrete mode\n        # string and `QuantizationConfig`, because `Layer.__new__` wraps\n        # `quantize` with `quantize_wrapper`, which calls\n        # `validate_and_resolve_config`.\n\n        # For structure-aware modes (`gptq`/`awq`), resolve and validate the\n        # layer structure *before* mutating any layer, and restrict\n        # quantization to the layers covered by the structure. Resolving it\n        # here (rather than after the mutation loop) guarantees that a\n        # missing/invalid structure leaves the model completely untouched\n        # instead of half-quantized (buffers allocated, dtype policies\n        # swapped). Only structure-covered layers are calibrated afterwards;\n        # quantizing any other layer would leave it uncalibrated, and its","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/models/model.py#L558-L594","documentation":"Error \"The `filters` argument must be a regex string, a list of regex strings, or a callable. Received: {type(filters)}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/models/model.py:576 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}