Importerror:无法导入名称' preprocess_input'从' tensorflow.keras.preprocessing'

发布于 2025-01-24 18:14:45 字数 1214 浏览 0 评论 0原文

我正在研究Google colab,我想从 tensorflow.keras.keras.preprocessing导入 preprocess_input

好吧,我正在使用 tensorflow = 2.8.0

我的代码:

from tensorflow.keras.preprocessing import preprocess_input

错误:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-2569fd104ea5> in <module>()
----> 1 from tensorflow.keras.preprocessing import preprocess_input

ImportError: cannot import name 'preprocess_input' from 'tensorflow.keras.preprocessing' (/usr/local/lib/python3.7/dist-packages/keras/api/_v2/keras/preprocessing/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

我应该安装或更改该错误,我只想使用 preprocess_input 进行模型预测目的就是所有建议!

I'm working on google colab , and I want to import preprocess_input from tensorflow.keras.preprocessing but this error keeps occurring , while whatever I import from tensorflow work fine except this .

well i'm using tensorflow = 2.8.0

my code :

from tensorflow.keras.preprocessing import preprocess_input

the error :

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-2569fd104ea5> in <module>()
----> 1 from tensorflow.keras.preprocessing import preprocess_input

ImportError: cannot import name 'preprocess_input' from 'tensorflow.keras.preprocessing' (/usr/local/lib/python3.7/dist-packages/keras/api/_v2/keras/preprocessing/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

what should I install or change to fix this error , i just want to use preprocess_input for model predicting purposes that's all , any suggestions please !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文