[PYTHON] [Dlib] Attribute Error: module'dlib' has no attribute ...

Error summary

The other day, when I tried to detect facial feature points using dlib, I ran into this error

Traceback (most recent call last):
  File "dlib.py", line 33, in <module>
    detector = dlib.get_frontal_face_detector()
AttributeError: module 'dlib' has no attribute 'get_frontal_face_detector'

It seemed that the environment was built properly because dlib was imported, but when I actually tried to use dlib, an AttributeError was thrown.

Solution

After a lot of research, the solution is written in stackoverflow here. I did.

Rename your file from dlib.py to something else, say dlib_project.py.

Apparently the problem was that the file name was dlib.py. I changed the file name to getFacialLandmarks.py and it worked fine. It seems better not to give the same file name as the library name ...

Recommended Posts

[Dlib] Attribute Error: module'dlib' has no attribute ...
[Wandb] Attribute Error: module'wandb' has no attribute'init'
[Python] Attribute Error:'list' object has no attribute'replace'
AttributeError: module'urllib' has no attribute'request' error in urllib.request
How to deal with module'tensorflow' has no attribute'〇〇'
AttributeError: module ‘torch.utils’ has no attribute ‘data’ solution
Use numpy without stress! (Interpretation of error "Attribute Error:'float' object has no attribute'sin'" (action?))
TensorFlow runtime Attribute Error: module'tensorflow' has no attribute'constant' is the first thing to doubt
AttributeError:'NoneType' object has no attribute'loader'