{"record":{"id":"dbd1b596a7dc45ea","repo":"keras-team/keras","slug":"input-input-index-with-name-spec-name-of-lay-dbd1b5","errorCode":null,"errorMessage":"Input {input_index} with name '{spec.name}' of layer '{layer_name}' is incompatible with the layer: expected shape={spec.shape}, found shape={shape}","messagePattern":"Input (.+?) with name '(.+?)' of layer '(.+?)' is incompatible with the layer: expected shape=(.+?), found shape=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/input_spec.py","lineNumber":256,"sourceCode":"                }:\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}\"\n                    )\n        # Check shape.\n        if spec.shape is not None:\n            spec_shape = spec.shape\n            if spec.allow_last_axis_squeeze:\n                if shape and shape[-1] == 1:\n                    shape = shape[:-1]\n                if spec_shape and spec_shape[-1] == 1:\n                    spec_shape = spec_shape[:-1]\n            for spec_dim, dim in zip(spec_shape, shape):\n                if spec_dim is not None and dim is not None:\n                    if spec_dim != dim:\n                        raise ValueError(\n                            f\"Input {input_index} with name '{spec.name}' of \"\n                            f\"layer '{layer_name}' is incompatible with the \"\n                            f\"layer: expected shape={spec.shape}, found \"\n                            f\"shape={shape}\"\n                        )\n","sourceCodeStart":238,"sourceCodeEnd":262,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/input_spec.py#L238-L262","documentation":"Error \"Input {input_index} with name '{spec.name}' of layer '{layer_name}' is incompatible with the layer: expected shape={spec.shape}, found shape={shape}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/input_spec.py:256 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"}