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'
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?