{"record":{"id":"6c9d329e16c0235f","repo":"keras-team/keras","slug":"invalid-images-dtype-expected-float-dtype-receiv-6c9d32","errorCode":null,"errorMessage":"Invalid images dtype: expected float dtype. Received: images.dtype={dtype}","messagePattern":"Invalid images dtype: expected float dtype\\. Received: images\\.dtype=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/numpy/ops/image.py","lineNumber":89,"sourceCode":"    grayscales = np.tensordot(images, rgb_weights, axes=(channels_axis, -1))\n    grayscales = np.expand_dims(grayscales, axis=channels_axis)\n    return grayscales.astype(original_dtype)\n\n\ndef rgb_to_hsv(images, data_format=None):\n    # Ref: dm_pix\n    images = convert_to_tensor(images)\n    dtype = backend.standardize_dtype(images.dtype)\n    data_format = standardize_data_format(data_format)\n    channels_axis = -1 if data_format == \"channels_last\" else -3\n    if len(images.shape) 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.shape}\"\n        )\n    if not backend.is_float_dtype(dtype):\n        raise ValueError(\n            \"Invalid images dtype: expected float dtype. \"\n            f\"Received: images.dtype={dtype}\"\n        )\n    eps = ml_dtypes.finfo(dtype).eps\n    images = np.where(np.abs(images) < eps, 0.0, images)\n    red, green, blue = np.split(images, 3, channels_axis)\n    red = np.squeeze(red, channels_axis)\n    green = np.squeeze(green, channels_axis)\n    blue = np.squeeze(blue, channels_axis)\n\n    def rgb_planes_to_hsv_planes(r, g, b):\n        value = np.maximum(np.maximum(r, g), b)\n        minimum = np.minimum(np.minimum(r, g), b)\n        range_ = value - minimum\n\n        safe_value = np.where(value > 0, value, 1.0)\n        safe_range = np.where(range_ > 0, range_, 1.0)\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/numpy/ops/image.py#L71-L107","documentation":"Error \"Invalid images dtype: expected float dtype. Received: images.dtype={dtype}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/numpy/ops/image.py:89 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"}