AttributeError: 'module' object has no attribute 'face' even after installed opencv-contrib-python
You probably have a module named cv.py (or cv2.py in this case) in your project - that means import cv2 is importing your own module, not opencv, and cv2.face will fail.
Delete your .py file and the .pyc that was generated, and the import should work again.
I got an error while running django server. I installed opencv-python and opencv-contrib-python through pip. Still getting the same error. Any suggestions?

Performing system checks...

Unhandled exception in thread started by 
Traceback (most recent call last):
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 124, in inner_run
    self.check(display_num_errors=True)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check include_deployment_checks=include_deployment_checks,
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks return checks.run_checks(**kwargs) 
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config return check_resolver(resolver)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver return check_method()
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check for pattern in self.url_patterns:
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance)
  File "/home/auxouser/.local/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/auxouser/Auxo/projects/training-ds/Day-9/Face_Recognition/Face_Recognition/urls.py", line 3, in 
    from MyAPP import views
  File "/home/auxouser/Auxo/projects/training-ds/Day-9/Face_Recognition/MyAPP/views.py", line 12, in 
    recognizer = cv2.face.LBPHFaceRecognizer_create()
AttributeError: 'module' object has no attribute 'face'