{"record":{"id":"282206f3905bd116","repo":"keras-team/keras","slug":"the-structure-of-inputs-doesn-t-match-the-expect","errorCode":null,"errorMessage":"The structure of `inputs` doesn't match the expected structure.\\nExpected: {model_inputs_struct}\\nReceived: inputs={inputs_struct}","messagePattern":"The structure of `inputs` doesn't match the expected structure\\.\\\\nExpected: (.+?)\\\\nReceived: inputs=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/models/functional.py","lineNumber":253,"sourceCode":"                tree.lists_to_tuples(inputs),\n                tree.lists_to_tuples(self._inputs_struct),\n            )\n        except:\n            model_inputs_struct = tree.map_structure(\n                lambda x: \"None\" if x is None else x.name,\n                self._inputs_struct,\n            )\n            inputs_struct = tree.map_structure(\n                lambda x: \"None\" if x is None else f\"Tensor(shape={x.shape})\",\n                inputs,\n            )\n            msg = (\n                \"The structure of `inputs` doesn't match the expected \"\n                f\"structure.\\nExpected: {model_inputs_struct}\\n\"\n                f\"Received: inputs={inputs_struct}\"\n            )\n            if raise_exception:\n                raise ValueError(msg)\n            warnings.warn(msg)\n\n    def _convert_inputs_to_tensors(self, flat_inputs):\n        converted = []\n        for x, input_tensor in zip(flat_inputs, self._inputs):\n            if x is None:\n                # Only enforce optional semantics when the input tensor was\n                # created by an `InputLayer`. For other kinds of tensors\n                # (e.g. tensors produced dynamically) preserve previous\n                # behavior and allow None to pass through.\n                input_layer = None\n                if (\n                    hasattr(input_tensor, \"_keras_history\")\n                    and input_tensor._keras_history\n                ):\n                    input_layer = input_tensor._keras_history.operation\n\n                if isinstance(input_layer, InputLayer):","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/models/functional.py#L235-L271","documentation":"Error \"The structure of `inputs` doesn't match the expected structure.\\nExpected: {model_inputs_struct}\\nReceived: inputs={inputs_struct}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/models/functional.py:253 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"}