ImageAI icon indicating copy to clipboard operation
ImageAI copied to clipboard

ModuleNotFoundError

Open nohing opened this issue 2 years ago • 1 comments

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?

nohing avatar Oct 11 '22 07:10 nohing

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

tankxiaodi avatar Oct 18 '22 15:10 tankxiaodi