{"record":{"id":"53696625c0bf93a9","repo":"keras-team/keras","slug":"first-dim-of-coordinates-must-be-the-same-as-the","errorCode":null,"errorMessage":"First dim of `coordinates` must be the same as the rank of `inputs`. Received inputs with shape: {inputs.shape} and coordinate leading dim of {coordinates.shape[0]}","messagePattern":"First dim of `coordinates` must be the same as the rank of `inputs`\\. Received inputs with shape: (.+?) and coordinate leading dim of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/jax/image.py","lineNumber":660,"sourceCode":"\n    coefficient_matrix = jnp.concatenate([x_rows, y_rows], axis=1)\n\n    target_vector = jnp.expand_dims(\n        jnp.concatenate([start_x, start_y], axis=-1), axis=-1\n    )\n\n    homography_matrix = jnp.linalg.solve(coefficient_matrix, target_vector)\n\n    return homography_matrix.squeeze(-1)\n\n\ndef map_coordinates(\n    inputs, coordinates, order, fill_mode=\"constant\", fill_value=0.0\n):\n    inputs = convert_to_tensor(inputs)\n    coordinates = convert_to_tensor(coordinates)\n    if coordinates.shape[0] != len(inputs.shape):\n        raise ValueError(\n            \"First dim of `coordinates` must be the same as the rank of \"\n            \"`inputs`. \"\n            f\"Received inputs with shape: {inputs.shape} and coordinate \"\n            f\"leading dim of {coordinates.shape[0]}\"\n        )\n    if len(coordinates.shape) < 2:\n        raise ValueError(\n            \"Invalid coordinates rank: expected at least rank 2.\"\n            f\" Received input with shape: {coordinates.shape}\"\n        )\n    if fill_mode not in MAP_COORDINATES_FILL_MODES:\n        raise ValueError(\n            \"Invalid value for argument `fill_mode`. Expected one of \"\n            f\"{set(MAP_COORDINATES_FILL_MODES)}. Received: \"\n            f\"fill_mode={fill_mode}\"\n        )\n    if order not in range(2):\n        raise ValueError(","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/jax/image.py#L642-L678","documentation":"Error \"First dim of `coordinates` must be the same as the rank of `inputs`. Received inputs with shape: {inputs.shape} and coordinate leading dim of {coordinates.shape[0]}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/jax/image.py:660 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"}