Search code examples
raspberry-piface-recognitionopencvpython

AttributeError: module 'cv2.cv2' has no attribtue 'face'


I'm getting error on this line, while my opencv-python version is 3.4.6.27 and opencv-contrib-python is 4.1.1.26.

Anyone know what's the problem?

recognizer = cv2.face.LBPHFaceRecognizer_create()

Solution

  • it work after i install a lower version of opencv-contrib-python which is same as my opencv-python version.

    pip install opencv-contrib-python==3.4.6.27