ModuleNotFoundError:没有名为“imageai”的模块

עמי*_*זון 3 python pycharm python-3.x

我正在尝试在 Pycharm 中安装用于 python 的对象检测或 imageai。我执行了所有安装方法,但这显示了错误ModuleNotFoundError: No module named \'imageai\'

\n\n
\n\n

这是我的代码

\n\n
from imageai.Prediction import ImagePrediction\nimport os\nexecution_path = os.getcwd()\n\n\nprediction = ImagePrediction()\nprediction.setModelTypeAsResNet()\nprediction.setModelPath(os.path.join(execution_path, "resnet50_weights_tf_dim_ordering_tf_kernels.h5"))\nprediction.loadModel()\n\n\npredictions, probabilities = prediction.predictImage(os.path.join(execution_path, "1.jpg"), result_count=5 )\nfor eachPrediction, eachProbability in zip(predictions, probabilities):\n    print(eachPrediction , " : " , eachProbability)\n
Run Code Online (Sandbox Code Playgroud)\n\n

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

\n\n
\n\n

输出

\n\n
 Traceback (most recent call last):\n  File "C:/Python37/files/FirstPrediction/FirstPrediction.py", line 1, in <module>\n    from imageai.Prediction import ImagePrediction\nModuleNotFoundError: No module named \'imageai\'\n
Run Code Online (Sandbox Code Playgroud)\n\n
\n\n
C:\\Users\\\xd7\x9e\xd7\xa9\xd7\xaa\xd7\x9e\xd7\xa9>pip show imageai\nName: imageai\nVersion: 2.0.2\nSummary: A flexible Computer Vision and Deep Learning library for applications and systems.\nHome-page: https://moses.specpal.science\nAuthor: Moses Olafenwa and John Olafenwa\nAuthor-email: UNKNOWN\nLicense: MIT\nLocation: c:\\python37\\lib\\site-packages\nRequires:\nRequired-by:\n
Run Code Online (Sandbox Code Playgroud)\n\n
\n\n
C:\\Users\\\xd7\x9e\xd7\xa9\xd7\xaa\xd7\x9e\xd7\xa9>pip -V\npip 18.1 from c:\\python37\\lib\\site-packages\\pip (python 3.7)\n
Run Code Online (Sandbox Code Playgroud)\n

小智 5

您首先需要从此处下载此 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
Run Code Online (Sandbox Code Playgroud)