[Python] module 'dlib' has no attribute 'get_frontal_face_detector' ERROR

Discussão em 'Python' iniciado por Stack, Junho 28, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to use Face_Recognition package on Anaconda, I have installed both dlib and face_recognition library

    but when I import face_recognition on my code, I get this error message

    import dlib
    import face_recognition



    ---------------------------------------------------------------------------
    AttributeError Traceback (most recent call last)
    <ipython-input-32-cc760b0b6613> in <module>()
    1 import dlib
    ----> 2 import face_recognition

    ~\Anaconda3\lib\site-packages\face_recognition\__init__.py in <module>()
    5 __version__ = '1.2.3'
    6
    ----> 7 from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance

    ~\Anaconda3\lib\site-packages\face_recognition\api.py in <module>()
    15 ImageFile.LOAD_TRUNCATED_IMAGES = True
    16
    ---> 17 face_detector = dlib.get_frontal_face_detector()
    18
    19 predictor_68_point_model = face_recognition_models.pose_predictor_model_location()

    AttributeError: module 'dlib' has no attribute 'get_frontal_face_detector'

    Continue reading...

Compartilhe esta Página