{"record":{"id":"3b060c7cf4e8e207","repo":"keras-team/keras","slug":"invalid-value-for-argument-method-expected-of-o-3b060c","errorCode":null,"errorMessage":"Invalid value for argument `method`. Expected of one {SCALE_AND_TRANSLATE_METHODS}. Received: method={method}","messagePattern":"Invalid value for argument `method`\\. Expected of one (.+?)\\. Received: method=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/backend/tensorflow/image.py","lineNumber":1059,"sourceCode":"    if use_rounding:\n        output = tf.clip_by_value(\n            tf.round(output), tf.reduce_min(x), tf.reduce_max(x)\n        )\n        output = tf.cast(output, x.dtype)\n    return output\n\n\ndef scale_and_translate(\n    images,\n    output_shape,\n    scale,\n    translation,\n    spatial_dims,\n    method,\n    antialias=True,\n):\n    if method not in SCALE_AND_TRANSLATE_METHODS:\n        raise ValueError(\n            \"Invalid value for argument `method`. Expected of one \"\n            f\"{SCALE_AND_TRANSLATE_METHODS}. Received: method={method}\"\n        )\n    if method in (\"linear\", \"bilinear\", \"trilinear\", \"triangle\"):\n        method = \"linear\"\n    elif method in (\"cubic\", \"bicubic\", \"tricubic\"):\n        method = \"cubic\"\n\n    images = convert_to_tensor(images)\n    scale = convert_to_tensor(scale)\n    translation = convert_to_tensor(translation)\n    kernel = _kernels[method]\n    dtype = backend.result_type(scale.dtype, translation.dtype)\n    scale = tf.cast(scale, dtype)\n    translation = tf.cast(translation, dtype)\n    return _scale_and_translate(\n        images,\n        output_shape,","sourceCodeStart":1041,"sourceCodeEnd":1077,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/backend/tensorflow/image.py#L1041-L1077","documentation":"Error \"Invalid value for argument `method`. Expected of one {SCALE_AND_TRANSLATE_METHODS}. Received: method={method}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/backend/tensorflow/image.py:1059 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"}