AttributeError:'NoneType'对象没有属性'predict'

#creating recognizer
recognizer= cv2.face_LBPHFaceRecognizer()
....
#predicting sad images
image_paths = [os.path.join(path,f) for f in os.listdir(path) if f.endswith('.sad')]
for image_path in image_paths:
    predict_image_pil = Image.open(image_path).convert('L')
    predict_image = np.array(predict_image_pil,'uint8')
    faces = faceCascade.detectMultiScale(predict_image)
    for (x,y,w,h) in faces:
        nbr_predicted,conf = recognizer.predict(predict_image[y: y + h,x: x + w])
....

发现错误

  

nbr_predicted,conf = identifierr.predict(predict_image [y:y + h,x:x + w])   AttributeError:“ NoneType”对象没有属性“ predict”

由于face_PredictCollector()也不起作用,如何解决此错误

zyw52718 回答:AttributeError:'NoneType'对象没有属性'predict'

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3063339.html

大家都在问