【发布时间】:2021-03-22 14:42:13
【问题描述】:
我在 Windows Powershell 中安装了 tensorflow,使用
pip install tensorflow
但是当在 anaconda jupyter notebook 中导入 keras(ResNet50) 的依赖项时
from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.resnet50 import preprocess_input, decode_predictions
import numpy as np
它给了我错误
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-22a529d637ab> in <module>
----> 1 from tensorflow.keras.applications.resnet50 import ResNet50
2 from tensorflow.keras.preprocessing import image
3 from tensorflow.keras.applications.resnet50 import preprocess_input, decode_predictions
4 import numpy as np
ModuleNotFoundError: No module named 'tensorflow'
【问题讨论】:
-
在 jupyter 中运行
!pip install tensorflow -
可能是因为你安装了多个 Python 并且你将包安装到了错误的一个。
标签: windows tensorflow keras pip anaconda