{"record":{"id":"ddcbf70158dd47ca","repo":"keras-team/keras","slug":"when-the-height-of-the-images-is-unknown-target","errorCode":null,"errorMessage":"When the height of the images is unknown, `target_height` must be specified.Received images.shape={images_shape} and target_height={self.target_height}","messagePattern":"When the height of the images is unknown, `target_height` must be specified\\.Received images\\.shape=(.+?) and target_height=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/ops/image.py","lineNumber":1928,"sourceCode":"                f\"Received: images.shape={images_shape}\"\n            )\n        _validate_crop_images_args(\n            self.top_cropping,\n            self.left_cropping,\n            self.bottom_cropping,\n            self.right_cropping,\n            self.target_height,\n            self.target_width,\n        )\n\n        if self.data_format == \"channels_last\":\n            height_axis, width_axis = -3, -2\n        else:\n            height_axis, width_axis = -2, -1\n        height, width = images_shape[height_axis], images_shape[width_axis]\n\n        if height is None and self.target_height is None:\n            raise ValueError(\n                \"When the height of the images is unknown, `target_height` \"\n                \"must be specified.\"\n                f\"Received images.shape={images_shape} and \"\n                f\"target_height={self.target_height}\"\n            )\n        if width is None and self.target_width is None:\n            raise ValueError(\n                \"When the width of the images is unknown, `target_width` \"\n                \"must be specified.\"\n                f\"Received images.shape={images_shape} and \"\n                f\"target_width={self.target_width}\"\n            )\n\n        target_height = self.target_height\n        if target_height is None:\n            target_height = height - self.top_cropping - self.bottom_cropping\n        target_width = self.target_width\n        if target_width is None:","sourceCodeStart":1910,"sourceCodeEnd":1946,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/ops/image.py#L1910-L1946","documentation":"Error \"When the height of the images is unknown, `target_height` must be specified.Received images.shape={images_shape} and target_height={self.target_height}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/ops/image.py:1928 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"}