E
E
Ernest Vardanyan2022-04-01 06:45:33
Python
Ernest Vardanyan, 2022-04-01 06:45:33

Why does it give BatchNormalization error?

Hello, I downloaded the code and indicated my photo and the trained model, everything seems to be easy, but I run it and give an error, what should I do?

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, "beach_output.jpg"),
  output_image_path=os.path.join(exec_path, "new_objects.jpg"),
  minimum_percentage_probability=90,
  display_percentage_probability=True,
  display_object_name=False
)


And here is the error

Traceback (most recent call last):
  File "C:\Users\Gegam\Питон\pyooooon\main.py", line 1, in <module>
    from imageai.Detection import ObjectDetection
  File "C:\Users\Gegam\anaconda3\envs\tf\lib\site-packages\imageai\Detection\__init__.py", line 17, in <module>
    from imageai.Detection.YOLOv3.models import yolo_main, tiny_yolo_main
  File "C:\Users\Gegam\anaconda3\envs\tf\lib\site-packages\imageai\Detection\YOLOv3\models.py", line 8, in <module>
    from keras.layers.normalization import BatchNormalization
ImportError: cannot import name 'BatchNormalization' from 'keras.layers.normalization' (C:\Users\Gegam\anaconda3\envs\tf\lib\site-packages\keras\layers\normalization\__init__.py)


HELP PLEASE, TOMORROW THE COURSE, AND I NEED TO WRITE A SIMPLE OBJECT IDENTIFIER IN THE PHOTO

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-04-01
@bacon

classic, well, freelance or pay a fellow student who can.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question