-1
Traceback (most recent call last):
  File "C:\Users\Ankan\AppData\Local\Programs\Python\Python311\Lib\tkinter\__init__.py", line 1948, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:\VS Code Projects\Attendace_management_system\AMS_Run.py", line 565, in trainimg
    recognizer = cv2.face.LBPHFaceRecognizer.create()
                 ^^^^^^^^
AttributeError: module 'cv2' has no attribute 'face'

I have installed opencv properly but still getting this error.

Markus
  • 5,976
  • 5
  • 6
  • 21
  • 1
    Please check: https://stackoverflow.com/questions/75729541/getting-attributeerror-module-cv2-has-no-attribute-face – Markus May 28 '23 at 22:29
  • @Ankan Ghosh. What are you running on pc or arm devices such as Raspberry Pi, Rock, etc? Also OpenCV version? – toyota Supra May 29 '23 at 00:48

1 Answers1

0

You can try to check OpenCV version: Verify the version of OpenCV installed on your system. You can do this by running the following code :

import cv2
print(cv2.__version__)

Or you can try to reinstall

Dan Mašek
  • 17,852
  • 6
  • 57
  • 85