keras-team/keras · error · ValueError
left_cropping must be >= 0. Received: left_cropping={left_cr
Error message
left_cropping must be >= 0. Received: left_cropping={left_cropping} What it means
Error "left_cropping must be >= 0. Received: left_cropping={left_cropping}" thrown in keras-team/keras.
Source
Thrown at keras/src/ops/image.py:1980
raise ValueError(
"bottom_cropping must be >= 0. "
f"Received: bottom_cropping={bottom_cropping}"
)
if target_height < 0:
raise ValueError(
"target_height must be >= 0. "
f"Received: target_height={target_height}"
)
if width is not None:
left_cropping = self.left_cropping
right_cropping = self.right_cropping
if left_cropping is None:
left_cropping = width - target_width - right_cropping
if right_cropping is None:
right_cropping = width - target_width - left_cropping
if left_cropping < 0:
raise ValueError(
"left_cropping must be >= 0. "
f"Received: left_cropping={left_cropping}"
)
if right_cropping < 0:
raise ValueError(
"right_cropping must be >= 0. "
f"Received: right_cropping={right_cropping}"
)
if target_width < 0:
raise ValueError(
"target_width must be >= 0. "
f"Received: target_width={target_width}"
)
images_shape[height_axis] = target_height
images_shape[width_axis] = target_width
return KerasTensor(shape=images_shape, dtype=images.dtype)
View on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/ops/image.py:1980 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/a7fb32c1d502eff0.
Report an issue: GitHub.