Importerror:无法导入名称' preprocess_input'从' tensorflow.keras.preprocessing'
我正在研究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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论