{"record":{"id":"10e6101c13e8edb5","repo":"keras-team/keras","slug":"only-one-of-pad-to-aspect-ratio-crop-to-aspec-10e610","errorCode":null,"errorMessage":"Only one of `pad_to_aspect_ratio` & `crop_to_aspect_ratio` can be `True`.","messagePattern":"Only one of `pad_to_aspect_ratio` & `crop_to_aspect_ratio` can be `True`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/image.py","lineNumber":280,"sourceCode":"    pad_to_aspect_ratio=False,\n    fill_mode=\"constant\",\n    fill_value=0.0,\n    data_format=\"channels_last\",\n):\n    data_format = backend.standardize_data_format(data_format)\n    if interpolation not in ALL_RESIZE_INTERPOLATIONS:\n        raise ValueError(\n            \"Invalid value for argument `interpolation`. Expected of one \"\n            f\"{ALL_RESIZE_INTERPOLATIONS}. Received: \"\n            f\"interpolation={interpolation}\"\n        )\n    if fill_mode != \"constant\":\n        raise ValueError(\n            \"Invalid value for argument `fill_mode`. Only `'constant'` \"\n            f\"is supported. Received: fill_mode={fill_mode}\"\n        )\n    if pad_to_aspect_ratio and crop_to_aspect_ratio:\n        raise ValueError(\n            \"Only one of `pad_to_aspect_ratio` & `crop_to_aspect_ratio` \"\n            \"can be `True`.\"\n        )\n    if not len(size) == 2:\n        raise ValueError(\n            \"Argument `size` must be a tuple of two elements \"\n            f\"(height, width). Received: size={size}\"\n        )\n\n    target_height, target_width = tuple(size)\n    images = get_ov_output(images)\n    rank = len(images.get_partial_shape())\n    if rank not in (3, 4):\n        raise ValueError(\n            \"Invalid images rank: expected rank 3 (single image) \"\n            \"or rank 4 (batch of images). Received input with shape: \"\n            f\"images.shape={images.get_partial_shape()}\"\n        )","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/image.py#L262-L298","documentation":"Error \"Only one of `pad_to_aspect_ratio` & `crop_to_aspect_ratio` can be `True`.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/image.py:280 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"}