P
P
Python Newbie2021-07-16 08:08:23
Python
Python Newbie, 2021-07-16 08:08:23

Bugs with ImageAI. What to do?

Hello.

Wanted to experiment with ImageAI.
According to Gosha Dudar's guide: https://youtu.be/Uj4O2_dwRiA?t=848

I wrote a small script for recognizing objects in a photo.

Here is the script:

import os

from imageai.Detection import ObjectDetection


exec_path = os.getcwd()

detector = ObjectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(os.path.join(
    exec_path, "resnet50_coco_best_v2.1.0")
)
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")
)


Version python 3.8

I used PyCharm
Installed all modules in the PyCharm terminal

At startup, it gives an error:
2021-07-16 09:54:59.334907: 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-07-16 09:54:59.335257: 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/Дом/PycharmProjects/openobj/venv/main.py", line 3, in <module>
    from imageai.Detection import ObjectDetection
  File "C:\Users\Дом\PycharmProjects\openobj\venv\lib\site-packages\imageai\Detection\__init__.py", line 17, in <module>
    from imageai.Detection.YOLO.utils import letterbox_image, yolo_eval, preprocess_input, retrieve_yolo_detections, draw_boxes
  File "C:\Users\Дом\PycharmProjects\openobj\venv\lib\site-packages\imageai\Detection\YOLO\utils.py", line 2, in <module>
    from keras import backend as K
  File "C:\Users\Дом\PycharmProjects\openobj\venv\lib\site-packages\keras\__init__.py", line 20, in <module>
    from . import initializers
  File "C:\Users\Дом\PycharmProjects\openobj\venv\lib\site-packages\keras\initializers\__init__.py", line 124, in <module>
    populate_deserializable_objects()
  File "C:\Users\Дом\PycharmProjects\openobj\venv\lib\site-packages\keras\initializers\__init__.py", line 82, in populate_deserializable_objects
    generic_utils.populate_dict_with_module_objects(
AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'

Process finished with exit code 1


Screenshot of PyCharm:
gzVXLBvB.jpg?download=1&name=%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%2016-07-2021%2008:05 :55.jpg

Help please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-07-16
@freeExec

CUDAnot installed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question