Skip to content

Note the available backends in docstring of keras.preprocessing.image.smart_resize() #21711

@ILCSFNO

Description

@ILCSFNO

Doc Issue

The doc of keras.preprocessing.image.smart_resize() shows its description as below:

backend_module: Backend module to use (if different from the default
backend).

For the repro below, I know that the default backend is keras.src.backend, but what backend can be served as other Backend module to use?

I tried keras.backend but failed. If there are some other backends available to use, I suggest to note some examples of them in the docstring above.

Thanks a lot!

Repro

import numpy as np
import keras
size = (256, 256)
backend_module = keras.backend
image = np.random.randint(0, 256, size=(size[0], size[1], 3), dtype=np.uint8)
resized_image = keras.preprocessing.image.smart_resize(image, size, interpolation='bicubic', backend_module=backend_module)
print('Original Image Shape:', image.shape)
print('Resized Image Shape:', resized_image.shape)

Output

AttributeError: module 'keras.api.backend' has no attribute 'convert_to_tensor'

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions