close

[Solved] AttributeError: module ‘cv2.cv2’ has no attribute ‘createLBPHFaceRecognizer’

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to make face Recognition application But I am facing following error AttributeError: module ‘cv2.cv2’ has no attribute ‘createLBPHFaceRecognizer’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How AttributeError: module ‘cv2.cv2’ has no attribute ‘createLBPHFaceRecognizer’ Error Occurs ?

I am trying to make face Recognition application But I am facing following error.

AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

How To Solve AttributeError: module ‘cv2.cv2’ has no attribute ‘createLBPHFaceRecognizer’ Error ?

  1. How To Solve AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' Error ?

    To Solve AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' Error You need to reinstall opencv-contrib so that first of all uninstall opencv-contrib with this command: pip uninstall opencv-python. Then just install opencv-contrib with this command: pip install opencv-contrib-python And my error solved.

  2. AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer'

    To Solve AttributeError: module 'cv2.cv2' has no attribute 'createLBPHFaceRecognizer' Error You need to reinstall opencv-contrib so that first of all uninstall opencv-contrib with this command: pip uninstall opencv-python. Then just install opencv-contrib with this command: pip install opencv-contrib-python And my error solved.

Solution 1: Reinstall opencv-contrib

You need to reinstall opencv-contrib so that first of all uninstall opencv-contrib with this command.

pip uninstall opencv-python

Then just install opencv-contrib with this command.

pip install opencv-contrib-python

And my error solved.

Solution 2: Use LBPHFaceRecognizer_create

First of all you need to install opencv-contrib with this command.

python -m pip install --user opencv-contrib-python

And then use LBPHFaceRecognizer_create like this.

cv2.face.LBPHFaceRecognizer_create() 

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment