gpt4 book ai didi

python - 模块未找到错误 : No module named 'imageai'

转载 作者:太空宇宙 更新时间:2023-11-04 08:30:54 26 4
gpt4 key购买 nike

我打算在 Pycharm 中为 python 安装对象检测或 imageai。我完成了所有安装方法,但这显示了错误 ModuleNotFoundError: No module named 'imageai'


这是我的代码

from imageai.Prediction import ImagePrediction
import os
execution_path = os.getcwd()


prediction = ImagePrediction()
prediction.setModelTypeAsResNet()
prediction.setModelPath(os.path.join(execution_path, "resnet50_weights_tf_dim_ordering_tf_kernels.h5"))
prediction.loadModel()


predictions, probabilities = prediction.predictImage(os.path.join(execution_path, "1.jpg"), result_count=5 )
for eachPrediction, eachProbability in zip(predictions, probabilities):
print(eachPrediction , " : " , eachProbability)

我需要做什么来修复它?我是 python 新手,请帮助我。


输出

 Traceback (most recent call last):
File "C:/Python37/files/FirstPrediction/FirstPrediction.py", line 1, in <module>
from imageai.Prediction import ImagePrediction
ModuleNotFoundError: No module named 'imageai'

C:\Users\משתמש>pip show imageai
Name: imageai
Version: 2.0.2
Summary: A flexible Computer Vision and Deep Learning library for applications and systems.
Home-page: https://moses.specpal.science
Author: Moses Olafenwa and John Olafenwa
Author-email: UNKNOWN
License: MIT
Location: c:\python37\lib\site-packages
Requires:
Required-by:

C:\Users\משתמש>pip -V
pip 18.1 from c:\python37\lib\site-packages\pip (python 3.7)

最佳答案

您首先需要从此处下载此 ImageAI whl 文件。 https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl

运行以下

pip install imageai-2.0.2-py3-none-any.whl

关于python - 模块未找到错误 : No module named 'imageai' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53071013/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com