我想在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)我该怎么做才能修好它?我是蟒蛇新手,请帮帮我。
输出量
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)发布于 2018-11-02 19:02:16
Terensflow不支持Python3.7,需要下载python3.6卸载python3.7并全部安装Python 3.6
发布于 2019-04-12 16:30:18
您首先需要下载这个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发布于 2019-08-02 19:38:45
此外,您还可以直接从ImageAI安装PyPi。
pip3 install imageai --upgradehttps://stackoverflow.com/questions/53071013
复制相似问题