{"record":{"id":"0ec2f3d5a2878e99","repo":"keras-team/keras","slug":"input-input-index-with-name-spec-name-of-lay-0ec2f3","errorCode":null,"errorMessage":"Input {input_index} with name '{spec.name}' of layer '{layer_name}' is incompatible with the layer: expected dtype={spec.dtype}, found dtype={dtype}","messagePattern":"Input (.+?) with name '(.+?)' of layer '(.+?)' is incompatible with the layer: expected dtype=(.+?), found dtype=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/input_spec.py","lineNumber":225,"sourceCode":"                    f\"Input {input_index} with name '{spec.name}' of layer \"\n                    f\"'{layer_name}' is incompatible with the layer: \"\n                    f\"expected max_ndim={spec.max_ndim}, \"\n                    f\"found ndim={ndim}\"\n                )\n        if spec.min_ndim is not None:\n            if ndim is not None and ndim < spec.min_ndim:\n                raise ValueError(\n                    f\"Input {input_index} with name '{spec.name}' of layer \"\n                    f\"'{layer_name}' is incompatible with the layer: \"\n                    f\"expected min_ndim={spec.min_ndim}, \"\n                    f\"found ndim={ndim}. \"\n                    f\"Full shape received: {shape}\"\n                )\n        # Check dtype.\n        if spec.dtype is not None:\n            dtype = backend.standardize_dtype(x.dtype)\n            if dtype != spec.dtype:\n                raise ValueError(\n                    f\"Input {input_index} with name '{spec.name}' of layer \"\n                    f\"'{layer_name}' is incompatible with the layer: \"\n                    f\"expected dtype={spec.dtype}, \"\n                    f\"found dtype={dtype}\"\n                )\n\n        # Check specific shape axes.\n        if spec.axes:\n            for axis, value in spec.axes.items():\n                if value is not None and shape[axis] not in {\n                    value,\n                    None,\n                }:\n                    raise ValueError(\n                        f\"Input {input_index} with name '{spec.name}' of layer \"\n                        f\"'{layer_name}' is incompatible with the layer: \"\n                        f\"expected axis {axis} of input shape to have value \"\n                        f\"{value}, but received input with shape {shape}\"","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/input_spec.py#L207-L243","documentation":"Error \"Input {input_index} with name '{spec.name}' of layer '{layer_name}' is incompatible with the layer: expected dtype={spec.dtype}, found dtype={dtype}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/input_spec.py:225 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"}