{"record":{"id":"1cbe95cb54d7c131","repo":"keras-team/keras","slug":"invalid-images-rank-expected-rank-3-single-image-1cbe95","errorCode":null,"errorMessage":"Invalid images rank: expected rank 3 (single image) or rank 4 (batch of images). Received input with shape: images.shape={images.get_partial_shape()}","messagePattern":"Invalid images rank: expected rank 3 \\(single image\\) or rank 4 \\(batch of images\\)\\. Received input with shape: images\\.shape=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/openvino/image.py","lineNumber":294,"sourceCode":"            \"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        )\n\n    if data_format == \"channels_last\":\n        height_axis, width_axis = (-3, -2)\n    else:\n        height_axis, width_axis = (-2, -1)\n\n    def _gather_dim(shape_tensor, axis):\n        axis_node = ov_opset.constant([axis], Type.i32).output(0)\n        axis0 = ov_opset.constant(0, Type.i32).output(0)\n        return ov_opset.gather(shape_tensor, axis_node, axis0).output(0)\n\n    def _floor_div_int(numerator, denominator):\n        numerator_f = ov_opset.convert(numerator, Type.f32).output(0)\n        denominator_f = ov_opset.convert(denominator, Type.f32).output(0)","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/openvino/image.py#L276-L312","documentation":"Error \"Invalid images rank: expected rank 3 (single image) or rank 4 (batch of images). Received input with shape: images.shape={images.get_partial_shape()}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/openvino/image.py:294 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"}