0

尝试使用 imageai 库和下载的预训练模型 Resnet50 实现基本的对象检测。我收到此错误

即使在将 Keras 降级到 2.3.1 并尝试以另一种方式调整 Keras 和 tensorflow 的版本之后。代码是:

from imageai.Detection import ObjectDetection
import os

execution_path = os.getcwd() 

detector = ObjectDetection()

detector.setModelTypeAsRetinaNet()

detector.setModelPath(os.path.join(execution_path,'resnet50_coco_best_v2.0.1.h5'
))

detector.loadModel()

custom_objects = detector.custom_objects(person=True, car=False)

detections = detector.detectCustomObjectsFromImage(input_image=os.path.join(execution_path,'pedestrian.png'),
        ouput_image_path=os.path.join(execution_path,'output_image.png'),custom_objects=custom_objects,
        minimum_percentage_probability=65)

for i in detections:
  print(i['name'] + ' : ' + i['percentage_probability'])

  print("-----------------------") 

                     

                

错误:

TypeError: type object got multiple values for keyword argument 'training'
4

0 回答 0