{"record":{"id":"4a9e7543e741b37b","repo":"keras-team/keras","slug":"pipeline-config-must-contain-a-layers-key-mapp","errorCode":null,"errorMessage":"`Pipeline` config must contain a `layers` key mapping to a list of serialized layers. Received config with layers={layers}.","messagePattern":"`Pipeline` config must contain a `layers` key mapping to a list of serialized layers\\. Received config with layers=(.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/preprocessing/pipeline.py","lineNumber":71,"sourceCode":"\n    def call(self, inputs, training=True, mask=None):\n        for layer in self._pipeline_layers:\n            kwargs = {}\n            if layer._call_has_mask_arg:\n                kwargs[\"mask\"] = mask\n            if layer._call_has_training_arg and training is not None:\n                kwargs[\"training\"] = training\n            outputs = layer(inputs, **kwargs)\n            inputs = outputs\n\n            mask = tree.map_structure(backend.get_keras_mask, outputs)\n        return outputs\n\n    @classmethod\n    def from_config(cls, config):\n        layers = config.get(\"layers\")\n        if not isinstance(layers, (list, tuple)):\n            raise ValueError(\n                \"`Pipeline` config must contain a `layers` key mapping to a \"\n                \"list of serialized layers. Received config with \"\n                f\"layers={layers}.\"\n            )\n        config = {**config}\n        config[\"layers\"] = [\n            serialization_lib.deserialize_keras_object(x) for x in layers\n        ]\n        return cls(**config)\n\n    def get_config(self):\n        config = {\n            \"layers\": serialization_lib.serialize_keras_object(\n                self._pipeline_layers\n            ),\n            \"name\": self.name,\n        }\n        return config","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/preprocessing/pipeline.py#L53-L89","documentation":"Raised in Pipeline.from_config(): the deserialization config dictionary either lacks a 'layers' key or its value is not a list of serialized layer configs. The offending input is the whole config object passed to from_config (typically produced by layer.get_config() or model loading), whose layers value is echoed in the message.","triggerScenarios":"Thrown at keras/src/layers/preprocessing/pipeline.py:71 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the config comes from a real Pipeline instance via get_config(), which always serializes layers as a list","If constructing the dict manually, include \"layers\": [<layer configs>] where each entry is itself a valid serialized layer dict","Avoid round-tripping the config through code that drops or renames the 'layers' key"],"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"}