OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.58k stars 2.19k forks source link

ModuleNotFoundError #770

Open nohing opened 1 year ago

nohing commented 1 year ago

Hello there, I use PyCharm on Linux Mint 20.3. When I run this script:

`from imageai.Prediction import ImagePrediction import os

execution_path = os.getcwd()
prediction = ImagePrediction() prediction.setModelTypeAsMobileNetV2()

prediction.setModelPath(os.path.join(execution_path, "mobilenet_v2.h5")) prediction.loadModel()

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

I get this error: Traceback (most recent call last): File "Brain.py", line 1, in from imageai.Prediction import ImagePrediction File "/home/amt1matt/PycharmProjects/Image_recognition_app/venv/lib/python3.8/site-packages/imageai/Prediction/init.py", line 1, in from ..Classification import ImageClassification File "/home/amt1matt/PycharmProjects/Image_recognition_app/venv/lib/python3.8/site-packages/imageai/Classification/init.py", line 1, in import tensorflow as tf ModuleNotFoundError: No module named 'tensorflow'

Can you help me to fix it?

tankxiaodi commented 1 year ago

You must follow the instructions strictly to install TensorFlow and its dependencies.