keras-team/keras · error · ValueError
Invalid value for argument `interpolation`. Expected of one
Error message
Invalid value for argument `interpolation`. Expected of one {RESIZE_INTERPOLATIONS}. Received: interpolation={interpolation} What it means
Error "Invalid value for argument `interpolation`. Expected of one {RESIZE_INTERPOLATIONS}. Received: interpolation={interpolation}" thrown in keras-team/keras.
Source
Thrown at keras/src/backend/numpy/ops/image.py:179
hsv_planes_to_rgb_planes(hue, saturation, value), axis=channels_axis
)
return images.astype(dtype)
def resize(
images,
size,
interpolation="bilinear",
antialias=False,
crop_to_aspect_ratio=False,
pad_to_aspect_ratio=False,
fill_mode="constant",
fill_value=0.0,
data_format=None,
):
data_format = standardize_data_format(data_format)
if interpolation not in RESIZE_INTERPOLATIONS:
raise ValueError(
"Invalid value for argument `interpolation`. Expected of one "
f"{RESIZE_INTERPOLATIONS}. Received: interpolation={interpolation}"
)
if fill_mode != "constant":
raise ValueError(
"Invalid value for argument `fill_mode`. Only `'constant'` "
f"is supported. Received: fill_mode={fill_mode}"
)
if pad_to_aspect_ratio and crop_to_aspect_ratio:
raise ValueError(
"Only one of `pad_to_aspect_ratio` & `crop_to_aspect_ratio` "
"can be `True`."
)
if not len(size) == 2:
raise ValueError(
"Argument `size` must be a tuple of two elements "
f"(height, width). Received: size={size}"
)View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/backend/numpy/ops/image.py:179 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/eba27d4c9429e463.
Report an issue: GitHub.