{"record":{"id":"8e1f20df573d68f9","repo":"keras-team/keras","slug":"incompatible-input-shapes-axis-values-shape1-axe","errorCode":null,"errorMessage":"Incompatible input shapes: axis values {shape1[axes[0]]} (at axis {axes[0]}) != {shape2[axes[1]]} (at axis {axes[1]}). Full input shapes: {shape1}, {shape2}","messagePattern":"Incompatible input shapes: axis values (.+?) \\(at axis (.+?)\\) != (.+?) \\(at axis (.+?)\\)\\. Full input shapes: (.+?), (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/merging/dot.py","lineNumber":287,"sourceCode":"            or len(input_shape) != 2\n        ):\n            raise ValueError(\n                f\"A `Dot` layer should be called on a list of 2 inputs. \"\n                f\"Received: input_shape={input_shape}\"\n            )\n        shape1 = input_shape[0]\n        shape2 = input_shape[1]\n        if shape1 is None or shape2 is None:\n            return\n        if isinstance(self.axes, int):\n            if self.axes < 0:\n                axes = [self.axes % len(shape1), self.axes % len(shape2)]\n            else:\n                axes = [self.axes] * 2\n        else:\n            axes = self.axes\n        if shape1[axes[0]] != shape2[axes[1]]:\n            raise ValueError(\n                f\"Incompatible input shapes: \"\n                f\"axis values {shape1[axes[0]]} (at axis {axes[0]}) != \"\n                f\"{shape2[axes[1]]} (at axis {axes[1]}). \"\n                f\"Full input shapes: {shape1}, {shape2}\"\n            )\n\n    def _merge_function(self, inputs):\n        if len(inputs) != 2:\n            raise ValueError(\n                f\"A `Dot` layer should be called on exactly 2 inputs. \"\n                f\"Received: inputs={inputs}\"\n            )\n        x1 = inputs[0]\n        x2 = inputs[1]\n\n        if isinstance(self.axes, int):\n            if self.axes < 0:\n                axes = [","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/merging/dot.py#L269-L305","documentation":"Error \"Incompatible input shapes: axis values {shape1[axes[0]]} (at axis {axes[0]}) != {shape2[axes[1]]} (at axis {axes[1]}). Full input shapes: {shape1}, {shape2}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/merging/dot.py:287 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"}