{"record":{"id":"c7a6e6fd9484155f","repo":"keras-team/keras","slug":"unknown-converter-attribute-attr","errorCode":null,"errorMessage":"Unknown converter attribute '{attr}'","messagePattern":"Unknown converter attribute '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/export/litert.py","lineNumber":189,"sourceCode":"            converter: tf.lite.TFLiteConverter instance to configure\n\n        Raises:\n            ValueError: If any kwarg is not a valid converter attribute\n        \"\"\"\n        for attr, value in self.kwargs.items():\n            if attr == \"target_spec\" and isinstance(value, dict):\n                # Handle nested target_spec settings\n                for spec_key, spec_value in value.items():\n                    if hasattr(converter.target_spec, spec_key):\n                        setattr(converter.target_spec, spec_key, spec_value)\n                    else:\n                        raise ValueError(\n                            f\"Unknown target_spec attribute '{spec_key}'\"\n                        )\n            elif hasattr(converter, attr):\n                setattr(converter, attr, value)\n            else:\n                raise ValueError(f\"Unknown converter attribute '{attr}'\")\n\n\ndef export_litert_via_torch(\n    model, filepath, input_signature=None, verbose=None, **kwargs\n):\n    \"\"\"Export Keras model to LiteRT via PyTorch backend.\"\"\"\n    from keras.src.backend.torch.core import device_scope\n    from keras.src.backend.torch.core import get_device\n\n    device = get_device()\n\n    # litert_torch internally imports JAX and unconditionally enables\n    # jax_enable_x64, which breaks dtype-sensitive tests elsewhere.\n    # We preserve the original setting and restore it after conversion.\n    with _preserve_jax_x64_state():\n        try:\n            import litert_torch\n        except ImportError:","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/export/litert.py#L171-L207","documentation":"Raised by _apply_converter_kwargs in keras/src/export/litert.py: extra kwargs are applied to the tf.lite.TFLiteConverter object by setattr, so each kwarg name must be an existing attribute of the converter (e.g. optimizations, representative_dataset). The given attr is not a converter attribute (typo or non-existent setting), so the loop raises.","triggerScenarios":"Thrown at keras/src/export/litert.py:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use valid TFLiteConverter attribute names, e.g. export_litert(model, optimizations=[tf.lite.Optimize.DEFAULT])","Consult tf.lite.TFLiteConverter docs/vars() for accepted attributes","Remove or fix misspelled kwarg names in the export call"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}