face_recognition icon indicating copy to clipboard operation
face_recognition copied to clipboard

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

Open afarane opened this issue 6 years ago • 24 comments

  • face_recognition version:
  • Python version:3.6.5 (64bit)
  • dlib version: 19.10
  • Operating System: win7(64)

Description

Installations . Note: No Conda installation on my Machine

  • pip3 install numpy

  • pip3 install scipy

  • pip3 install dlib

  • pip3 install Pillow

  • pip3 install --no-dependencies face_recognition

  • pip3 install face_recognition_models

What I Did

I Ran this File : https://github.com/afarane/Face_Recognition/blob/master/AFR.py

Gives Me Following Error . Why ?

Traceback (most recent call last): File "0_iFaces.py", line 3, in import face_recognition File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-pac from .api import load_image_file, face_locations, batch_face_locations, File "C:\Users\username\AppData\Local\Programs\Python\Python36-32\lib\site-pac face_detector = dlib.get_frontal_face_detector() AttributeError: module 'dlib' has no attribute 'get_frontal_face_detector'

afarane avatar Apr 09 '18 07:04 afarane

Have the same issue, let me know if you found a solution yet

vinitmuchhala avatar May 09 '18 23:05 vinitmuchhala

I meet the same problem when I run face_recognition programs on Mac.

Napolcc avatar Jun 22 '18 00:06 Napolcc

Anything? I do see a solution here but no clue how they resolved this */pyc file"

https://stackoverflow.com/questions/39518871/attributeerror-module-object-has-no-attribute-get-frontal-face-detector

awaiskaleemtnr avatar Jun 25 '18 11:06 awaiskaleemtnr

They just mean they deleted any *.pyc files that were in that folder.

ageitgey avatar Jun 25 '18 15:06 ageitgey

me too

MyFlowerGirl avatar Jan 21 '19 09:01 MyFlowerGirl

after installing dliv with setup.py, had that problem. solved by opening "Available packages" and installing dlib from there. (had to pip install numpy also)

anigno avatar May 18 '19 21:05 anigno

re-install dlib works for me. pip uninstall dlib pip install dlib OS: windows 10

Hamiltonsjtu avatar May 31 '19 08:05 Hamiltonsjtu

lol you just can't name the file as "dlib.py" coz you're importing dlib. which will result in importing itself. so just rename the file to anything.py.

bamwani avatar Mar 03 '20 11:03 bamwani

where i can find dlib.py

Geethavani-droid avatar May 04 '20 14:05 Geethavani-droid

AttributeError: module dlib has no shape predictor. Can any one help me.

vidya414 avatar May 18 '20 16:05 vidya414

AttributeError: module dlib has no shape predictor. Can any one help me.

i am facing the same issue .

jhonnysrinivas avatar May 19 '20 09:05 jhonnysrinivas

this is really irritating i am getting the same errors

PhoenixZX200 avatar Jun 26 '20 03:06 PhoenixZX200

@ageitgey @vinitmuchhala @Hamiltonsjtu @bamwani @Napolcc return self.face_detector(image, 1) AttributeError: 'PRN' object has no attribute 'face_detector'

punitha-valli avatar Aug 26 '20 09:08 punitha-valli

after installing dliv with setup.py, had that problem. solved by opening "Available packages" and installing dlib from there. (had to pip install numpy also)

How had you solved it

Mohdyusuf786 avatar Dec 05 '20 12:12 Mohdyusuf786

after installing dliv with setup.py, had that problem. solved by opening "Available packages" and installing dlib from there. (had to pip install numpy also)

I also installed dlib from setup.py and after that i had installed pip install face-recognition but getting same error

Mohdyusuf786 avatar Dec 05 '20 12:12 Mohdyusuf786

has anyone found the answer?

huzaifa-99 avatar Dec 18 '20 17:12 huzaifa-99

I have found the solution I used python 3.6.4 version and it worked!!!!! Also install cmake

PhoenixZX200 avatar Dec 19 '20 06:12 PhoenixZX200

I have found the solution I used python 3.6.4 version and it worked!!!!! Also install cmake

how man please help me

i think all are bull shitting on this issue

sibujacob avatar Jun 18 '21 04:06 sibujacob

AttributeError: module dlib has no shape predictor. Can any one help me.

you have to download the dlib models. just type dlib models git and u will find models, download them and paste the path in your code.

BVishal-Geek avatar Oct 14 '21 20:10 BVishal-Geek

Hi

What was my question ?

On Fri, Oct 15, 2021 at 2:00 AM Vishal_bakshi @.***> wrote:

AttributeError: module dlib has no shape predictor. Can any one help me.

you have to download the dlib models. just type dlib models git and u will find models, download them and paste the path in your code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ageitgey/face_recognition/issues/440#issuecomment-943706527, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKFWQDCPKTYG63ANXMW7SNTUG44U3ANCNFSM4EZQKBHQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

sibujacob avatar Oct 15 '21 02:10 sibujacob

AttributeError: module 'dlib' has no attribute 'get_frontal_face_detector' 试过上面的各种方法都不行。还有其他的方法吗

liuli996624 avatar Nov 18 '21 12:11 liuli996624

You can check that your method are exist in module:

for method in dir(obj):
    if callable(getattr(obj, method)):
        print(method)

will print into console all avaible methods

LussRus avatar Jan 24 '22 06:01 LussRus

I tried re-installing dlib but still facing the same issue on Mac.

zoekimm avatar Jan 29 '22 03:01 zoekimm

Try it on a different python version such as 3.6.5 or 3.8.5

tneilc avatar Jan 29 '22 09:01 tneilc