Problem importint load_img from tensorflow.keras.utils
Hi @franknganmo ,

Could you please confirm the code snippet you are using ?

Please note that if you are using [tf.keras.preprocessing.image.load_img](https://www.tensorflow.org/api_docs/python/tf/keras/utils/load_img) API then it is deprecated and may not work.

Please use [tf.keras.utils.load_img](https://www.tensorflow.org/api_docs/python/tf/keras/utils/load_img) for the image loading purposes. For more details please refer to attached documentation sources.

I have also tested the imports in colab and found that `keras.preprocessing.image.load_img` not working as reported but `keras.utils.load_img ` is working.Please refer to attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/75c5981c8802070f1e4b5c37f14f68c1/60746.ipynb).

Hope this will resolve your issue.

Thanks! def predictImage(img_path='my_image.jpg', arrayImg=None, printData=True):
    crops = []
    if arrayImg == None:
        img = image.load_img(img_path)
        crops = np.array(getCropImgs(img, needRotations=False), np.float16)
        crops = np.divide(crops, 255.)
    Image.fromarray(np.array(crops[0]), "RGB").show() I use from tensorflow.keras.utils import load_img Hi @franknganmo ,

I think you are using the API wrong. You have to call the API like `tf.keras.utils.load_img()`  .

From your code you calling it as image.load_img(img_path) which makes me think that you are calling the API on image which is not correct.Since if you have imported `load_img` already using  `tensorflow.keras.utils import load_img` then you can directly use it in code.

May be replacing` img=image.load_img(img_path)` with `img=load_img(img_path)` might works for you.

I have attached a sample colab gist on how to use this API . Please refer this and change code accordingly and let us know if it helps.

Thanks! good Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60746">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60746">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Build/Install

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

2.12.0

### Custom Code

Yes

### OS Platform and Distribution

Windows

### Mobile device

_No response_

### Python version

3.10.11

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

Using load_img to import an image into my program's function

### Standalone code to reproduce the issue

```shell
ImportError: cannot import name 'load_img' from 'keras.preprocessing.image'
```


### Relevant log output

_No response_</details>