keras-team/keras · error · ValueError
Invalid value for argument `interpolation`. Expected of one
Error message
Invalid value for argument `interpolation`. Expected of one {set(AFFINE_TRANSFORM_INTERPOLATIONS.keys())}. Received: interpolation={interpolation} What it means
Error "Invalid value for argument `interpolation`. Expected of one {set(AFFINE_TRANSFORM_INTERPOLATIONS.keys())}. Received: interpolation={interpolation}" thrown in keras-team/keras.
Source
Thrown at keras/src/backend/jax/image.py:420
padded_img = images
images = padded_img
return jax.image.resize(
images, size, method=interpolation, antialias=antialias
)
def affine_transform(
images,
transform,
interpolation="bilinear",
fill_mode="constant",
fill_value=0,
data_format=None,
):
data_format = backend.standardize_data_format(data_format)
if interpolation not in AFFINE_TRANSFORM_INTERPOLATIONS.keys():
raise ValueError(
"Invalid value for argument `interpolation`. Expected of one "
f"{set(AFFINE_TRANSFORM_INTERPOLATIONS.keys())}. Received: "
f"interpolation={interpolation}"
)
if fill_mode not in AFFINE_TRANSFORM_FILL_MODES:
raise ValueError(
"Invalid value for argument `fill_mode`. Expected of one "
f"{AFFINE_TRANSFORM_FILL_MODES}. Received: fill_mode={fill_mode}"
)
transform = convert_to_tensor(transform)
if len(images.shape) not in (3, 4):
raise ValueError(
"Invalid images rank: expected rank 3 (single image) "
"or rank 4 (batch of images). Received input with shape: "
f"images.shape={images.shape}"
)View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/backend/jax/image.py:420 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25).
Data as JSON: /api/errors/596726b33f2cdcf7.
Report an issue: GitHub.