{"record":{"id":"db2e068ab32dc0ba","repo":"keras-team/keras","slug":"first-dim-of-coordinates-must-be-the-same-as-the-db2e06","errorCode":null,"errorMessage":"First dim of `coordinates` must be the same as the rank of `inputs`. Received inputs with shape: {input_arr.shape} and coordinate leading dim of {coordinate_arrs.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/tensorflow/image.py","lineNumber":658,"sourceCode":"    return [(index, weight)]\n\n\ndef _linear_indices_and_weights(coordinate):\n    lower = tf.floor(coordinate)\n    upper_weight = coordinate - lower\n    lower_weight = 1 - upper_weight\n    index = tf.cast(lower, tf.int32)\n    return [(index, lower_weight), (index + 1, upper_weight)]\n\n\ndef map_coordinates(\n    inputs, coordinates, order, fill_mode=\"constant\", fill_value=0.0\n):\n    input_arr = convert_to_tensor(inputs)\n    coordinate_arrs = convert_to_tensor(coordinates)\n\n    if coordinate_arrs.shape[0] != len(input_arr.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: {input_arr.shape} and coordinate \"\n            f\"leading dim of {coordinate_arrs.shape[0]}\"\n        )\n    if len(coordinate_arrs.shape) < 2:\n        raise ValueError(\n            \"Invalid coordinates rank: expected at least rank 2.\"\n            f\" Received input with shape: {coordinate_arrs.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.keys())}. Received: \"\n            f\"fill_mode={fill_mode}\"\n        )\n\n    fill_value = convert_to_tensor(fill_value, dtype=input_arr.dtype)","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/tensorflow/image.py#L640-L676","documentation":"Error \"First dim of `coordinates` must be the same as the rank of `inputs`. Received inputs with shape: {input_arr.shape} and coordinate leading dim of {coordinate_arrs.shape[0]}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/tensorflow/image.py:658 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"}