M
M
Mikhail9992021-10-28 22:24:28
Python
Mikhail999, 2021-10-28 22:24:28

Does it give me an error when I run imageai?

According to the video tutorial by Gosha Dudar on imageai, I repeated the code, but it does not work and gives an error. I have installed all the necessary libraries from the documentation, but I still get an error. How it is possible to eliminate it?

from imageai.Detection import ObjectDetection
import os

exec_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(exec_path, "resnet50_coco_best_v2.1.0.h5"))
detector.loadModel()

list = detector.detectObjectsFromImage(
  input_image=os.path.join(exec_path, "objects.jpg"),
  output_image_path=os.path.join(exec_path, "new_objects.jpg"),
  minimum_percentage_probability=90,
  display_percentage_probability=True,
  display_object_name=False
)

617af8e88da51753846138.png
C:\Users\User\Downloads\imageAI\venv\Scripts\python.exe C:/Users/User/Downloads/imageAI/venv/main.py
2021-10-28 19:38:22.762717:W tensorflow/stream_executor/ platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-10-28 19:38:22.763252: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "C:\Users\User\Downloads\imageAI\venv\main.py", line 1, in
from imageai.Detection import ObjectDetection
File "C:\Users\User\Downloads\imageAI \venv\lib\site-packages\imageai\Detection\__init__.py", line 17, in
from imageai.Detection.YOLOv3.models import yolo_main, tiny_yolo_main
File "C:\Users\User\Downloads\imageAI\venv\lib\site-packages\imageai\Detection\YOLOv3\models.py", line 8, in
from keras .layers.normalization import BatchNormalization
ImportError: cannot import name 'BatchNormalization' from 'keras.layers.normalization' (C:\Users\User\Downloads\imageAI\venv\lib\site-packages\keras\layers\normalization\__init__. py)

Process finished with exit code 1

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question