{"record":{"id":"1b5ac244d2c591d8","repo":"keras-team/keras","slug":"missing-data-for-input-name-you-passed-a-data","errorCode":null,"errorMessage":"Missing data for input \"{name}\". You passed a data dictionary with keys {list(inputs.keys())}. Expected the following keys: {names}","messagePattern":"Missing data for input \"(.+?)\"\\. You passed a data dictionary with keys (.+?)\\. Expected the following keys: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/input_spec.py","lineNumber":150,"sourceCode":"            input tensors.\n        layer_name: String, name of the layer (for error message formatting).\n\n    Raises:\n        ValueError: in case of mismatch between\n            the provided inputs and the expectations of the layer.\n    \"\"\"\n    if not input_spec:\n        return\n\n    input_spec = tree.flatten(input_spec)\n    if isinstance(inputs, dict):\n        # Flatten `inputs` by reference order if input spec names are provided\n        names = [spec.name for spec in input_spec]\n        if all(names):\n            list_inputs = []\n            for name in names:\n                if name not in inputs:\n                    raise ValueError(\n                        f'Missing data for input \"{name}\". '\n                        \"You passed a data dictionary with keys \"\n                        f\"{list(inputs.keys())}. \"\n                        f\"Expected the following keys: {names}\"\n                    )\n                list_inputs.append(inputs[name])\n            inputs = list_inputs\n\n    inputs = tree.flatten(inputs)\n    if len(inputs) != len(input_spec):\n        # Provide appropriate error message for dict inputs.\n        spec_names = [spec.name for spec in input_spec if spec is not None]\n        if len(spec_names) == len(input_spec) and all(spec_names):\n            raise ValueError(\n                f'Layer \"{layer_name}\" expects {len(input_spec)} named '\n                f\"input(s) with keys {spec_names}, but it received \"\n                f\"{len(inputs)} input tensors. Pass inputs as a dict, e.g. \"\n                \"`layer({\"","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/input_spec.py#L132-L168","documentation":"Error \"Missing data for input \"{name}\". You passed a data dictionary with keys {list(inputs.keys())}. Expected the following keys: {names}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/input_spec.py:150 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"}