{"record":{"id":"44ce3679aa0ae7db","repo":"keras-team/keras","slug":"invalid-value-for-argument-fill-mode-expected-o-44ce36","errorCode":null,"errorMessage":"Invalid value for argument `fill_mode`. Expected one of {set(MAP_COORDINATES_FILL_MODES.keys())}. Received: fill_mode={fill_mode}","messagePattern":"Invalid value for argument `fill_mode`\\. Expected one of (.+?)\\. Received: fill_mode=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/ops/image.py","lineNumber":942,"sourceCode":"        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.keys())}. Received: \"\n            f\"fill_mode={fill_mode}\"\n        )\n    if order not in range(2):\n        raise ValueError(\n            \"Invalid value for argument `order`. Expected one of \"\n            f\"{[0, 1]}. Received: order={order}\"\n        )\n    # SciPy's implementation of map_coordinates handles boundaries incorrectly,\n    # unless mode='reflect'. For order=1, this only affects interpolation\n    # outside the bounds of the original array.\n    # https://github.com/scipy/scipy/issues/2640\n    padding = [\n        (\n            max(-np.floor(c.min()).astype(int) + 1, 0),\n            max(np.ceil(c.max()).astype(int) + 1 - size, 0),\n        )\n        for c, size in zip(coordinates, inputs.shape)\n    ]\n    shifted_coords = [c + p[0] for p, c in zip(padding, coordinates)]\n    pad_mode = {\n        \"nearest\": \"edge\",\n        \"mirror\": \"reflect\",","sourceCodeStart":924,"sourceCodeEnd":960,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/ops/image.py#L924-L960","documentation":"Error \"Invalid value for argument `fill_mode`. Expected one of {set(MAP_COORDINATES_FILL_MODES.keys())}. Received: fill_mode={fill_mode}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/numpy/ops/image.py:942 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"}