{"record":{"id":"d997ea8bcdd02459","repo":"keras-team/keras","slug":"unknown-target-spec-attribute-spec-key","errorCode":null,"errorMessage":"Unknown target_spec attribute '{spec_key}'","messagePattern":"Unknown target_spec attribute '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/export/litert.py","lineNumber":183,"sourceCode":"            return converter.convert()\n\n    def _apply_converter_kwargs(self, converter):\n        \"\"\"Apply additional converter settings from kwargs.\n\n        Args:\n            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","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/export/litert.py#L165-L201","documentation":"Raised by _apply_converter_kwargs in keras/src/export/litert.py: user-supplied kwargs may configure nested target_spec settings via a dict, but each key in that dict must be an existing attribute of the tf.lite converter's target_spec object. The given spec_key does not exist on target_spec (typo or unsupported setting), so the ValueError fires.","triggerScenarios":"Thrown at keras/src/export/litert.py:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use valid target_spec attribute names, e.g. \"supported_ops\" or \"supported_types\"","Check dir(converter.target_spec) on a tf.lite.TFLiteConverter for valid keys","Fix typos in the nested target_spec dict passed to export_litert"],"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"}