Answer the question
In order to leave comments, you need to log in
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
)
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)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question