我试图实现以下代码:
from imageai.Detection import ObjectDetection
detector = ObjectDetection()
model_path = "yolo-tiny.h5"
input_path = "passport_photo.png"
output_path = "new.jpg"
detector.setModelTypeAsTinyYOLOv3()
detector.setModelPath(model_path)
detector.loadModel()
detection = detector.detectObjectsFromImage(input_image=input_path, output_image_path=output_path)
for eachItem in detection:
print(eachItem["name"] , " : ", eachItem["percentage_probability"])
但出现以下错误:
ValueError: Subshape 必须计算 start >= end,因为 stride 为负,但为 0 和 2(从 start 0 和 end 9223372036854775807 计算,超过 rank 2 和 stride-1 的形状)。
我尝试将 tensorflow v2.5.0 降级到 v2.4.0,因为我在某处读到它可能会有所帮助,但它没有。任何人都可以提出一些建议吗?