Giter Club home page Giter Club logo

Comments (30)

ageitgey avatar ageitgey commented on May 2, 2024 9

The issue is most likely that dlib was compiled with support for AVX and/or SSE4 instructions, but your cpu is too old to support them (pre-2011, I think).

The easiest solution is to download dlib and compile it yourself. But when you do that, you need to make one change.

Before compiling dlib, edit dlib's tools/python/CMakeLists.txt file from:

set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")

to:

set(USE_SSE2_INSTRUCTIONS ON CACHE BOOL "Use SSE2 instructions")

And then compile and install dlib and the dlib python extensions. Hopefully that should fix it.

from face_recognition.

gujifly avatar gujifly commented on May 2, 2024 4

The issue is most likely that dlib was compiled with support for AVX and/or SSE4 instructions, but your cpu is too old to support them (pre-2011, I think).
The easiest solution is to download dlib and compile it yourself. But when you do that, you need to make one change.
Before compiling dlib, edit dlib's tools/python/CMakeLists.txt file from:

set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")

to:

set(USE_SSE2_INSTRUCTIONS ON CACHE BOOL "Use SSE2 instructions")

And then compile and install dlib and the dlib python extensions. Hopefully that should fix it.

Hello, I didn't find this line in the specified location and also my macbook(macbook pro 2010 mid) supports SSE4 but doesn't support AVX. How do I build dlib taking into consideration this issue. I tried reinstalling dlib a lot of times but each time I get Illegal Instruction: 4.

I find this line in " ./dlib/dlib/cmake_utils/set_compiler_specific_options.cmake" ,so change and recomplie , it work!
image

from face_recognition.

abala003 avatar abala003 commented on May 2, 2024 1

Correct. My Laptop is from 2008. The solution you suggested has fixed my issue. The script is able to recognize faces. Thank you.

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024 1

@Forsskieken The Intel Xeon W3680 (released 2010) doesn't support AVX instructions (released 2011). So that's why it's failing. Sorry! Your only option is to compile dlib without AVX enabled.

from face_recognition.

PreethiRe avatar PreethiRe commented on May 2, 2024 1

I am getting error like this..
import face_recognition
File "C:\Python27\lib\site-packages\face_recognition_init_.py", line 7, in
from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "C:\Python27\lib\site-packages\face_recognition\api.py", line 22, in
face_encoder =dlib.face_recognition_model_v1(face_recognition_model)
AttributeError: 'module' object has no attribute 'face_recognition_model_v1'

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024 1

@PreethiRe Please don't post on closed issues with new unrelated problems. In any case, the answer to your question is here in the README. You need to upgrade to a newer version of dlib.

from face_recognition.

PreethiRe avatar PreethiRe commented on May 2, 2024 1

how to fix this..?
face_distances = face_recognition.face_distance(known_encodings, image_to_test_encoding)
AttributeError: module 'face_recognition' has no attribute 'face_distance'

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024 1

@PreethiRe Again, please don't post on closed issues with new unrelated problems. But I'm guessing you accidentally called your own file "face_recognition.py". You can't name your own file that or Python will find that file instead of the library you are trying to import.

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024 1

@Soulzerz Try installing dlib by downloading the source code and running this command inside the source folder:

python3 setup.py install --no USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA

from face_recognition.

cuimiao187561 avatar cuimiao187561 commented on May 2, 2024

face_recognition version:0.1.0
Python version:2.7.6
Operating System:ubantu 14.04
I encountered the same problem,When i run the code,
I get an error "Illegal Instruction" at the following line
gnss523@gnss523:~/Desktop/face_recognition-master/examples$ python find_faces_in_picture.py
Illegal instruction (core dumped)

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024

Did you follow the instructions above?

from face_recognition.

cuimiao187561 avatar cuimiao187561 commented on May 2, 2024

I try this method

from face_recognition.

ncbonde avatar ncbonde commented on May 2, 2024

i have got this error ...how to solve it??

` >>>import face_recognition

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/face_recognition/init.py", line 7, in
from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces
File "/usr/local/lib/python2.7/dist-packages/face_recognition/api.py", line 21, in
face_encoder = dlib.face_recognition_model_v1(face_recognition_model)
AttributeError: 'module' object has no attribute 'face_recognition_model_v1`

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024

AttributeError: 'module' object has no attribute 'face_recognition_model_v1 means that the version of dlib you are using is too old. You need to use dlib 19.4 or newer.

from face_recognition.

Forsskieken avatar Forsskieken commented on May 2, 2024

Hi ageitgeym
Thanks for putting this togheter.
I've got error Process finished with exit code 132 (interrupted by signal 4: SIGILL)
when I run the examples, I also cheked if my processor was SSE4 capable (Intel® Xeon® Processor W3680) so before downloading dlib and compiling I wanted to know if there's something else I should do.

thanks for reading and your vmmachine

from face_recognition.

Forsskieken avatar Forsskieken commented on May 2, 2024

Hi There the compilation succeeded but when I want to install it I get following error:

deeplearning@deep-learning-virtual-machine:~/Downloads/dlib-19.4$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 36, in <module>
    from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
ImportError: No module named setuptools.command.bdist_egg

python3-setuptools is already the newest version (20.7.0-1).

I then did:

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo python3 setup.py install

But how do I make sure pycharms uses this newly compiled version
Ok it seems "sudo python3 setup install" instead of "sudo python setup.." did the trick

Thanks and kind Regards

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024

@Forsskieken The problem was python setup.py runs Python 2, which is totally separate and doesn't have access to any libraries you installed for Python 3. So running python3 setup.py instead is the key.

You can choose when version of Python you are using in Pycharm by going to your project settings and changing the interpreter it's using. Just make sure you choose Python 3 for any new projects you create.

from face_recognition.

PreethiRe avatar PreethiRe commented on May 2, 2024

from face_recognition.

Soulzerz avatar Soulzerz commented on May 2, 2024

I have an acer aspire es1-512, I'm facing this error and have already tried the easy solution proposed. And don't know what else to do.
"Dlib was compiled to use AVX instructions, but these aren't available on your machine.
Illegal instruction (core dumped)"

from face_recognition.

Soulzerz avatar Soulzerz commented on May 2, 2024

@ageitgey Thanks, that made it work! 😄

from face_recognition.

ageitgey avatar ageitgey commented on May 2, 2024

Great! :)

from face_recognition.

rjtmehta99 avatar rjtmehta99 commented on May 2, 2024

Hi, I have been getting this error and I'm unable to understand why this keeps on happening.
Any help would be appreciated !

import face_recognition_models

image = face_recognition_models.load_image_file("abc.jpg")
face_locations = face_recognition_models.face_locations(image)

Traceback (most recent call last):

File "", line 3, in
image = face_recognition_models.load_image_file("abc.jpg")

AttributeError: module 'face_recognition_models' has no attribute 'load_image_file'

from face_recognition.

akhilesh-pandey avatar akhilesh-pandey commented on May 2, 2024

Hi, I am new to PyCharm. I needed a library face_recognition for my project so I installed it using pip install face_recognition. Now i am able to import it in ipython but not in PyCharm. I get

ImportError: No module named 'face_recognition'

Thanks for your help.

from face_recognition.

salonimundra avatar salonimundra commented on May 2, 2024

The issue is most likely that dlib was compiled with support for AVX and/or SSE4 instructions, but your cpu is too old to support them (pre-2011, I think).

The easiest solution is to download dlib and compile it yourself. But when you do that, you need to make one change.

Before compiling dlib, edit dlib's tools/python/CMakeLists.txt file from:

set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")

to:

set(USE_SSE2_INSTRUCTIONS ON CACHE BOOL "Use SSE2 instructions")

And then compile and install dlib and the dlib python extensions. Hopefully that should fix it.

Hello, I didn't find this line in the specified location and also my macbook(macbook pro 2010 mid) supports SSE4 but doesn't support AVX. How do I build dlib taking into consideration this issue. I tried reinstalling dlib a lot of times but each time I get Illegal Instruction: 4.

from face_recognition.

steffanjensen avatar steffanjensen commented on May 2, 2024

The issue is most likely that dlib was compiled with support for AVX and/or SSE4 instructions, but your cpu is too old to support them (pre-2011, I think).
The easiest solution is to download dlib and compile it yourself. But when you do that, you need to make one change.
Before compiling dlib, edit dlib's tools/python/CMakeLists.txt file from:

set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")

to:

set(USE_SSE2_INSTRUCTIONS ON CACHE BOOL "Use SSE2 instructions")

And then compile and install dlib and the dlib python extensions. Hopefully that should fix it.

Hello, I didn't find this line in the specified location and also my macbook(macbook pro 2010 mid) supports SSE4 but doesn't support AVX. How do I build dlib taking into consideration this issue. I tried reinstalling dlib a lot of times but each time I get Illegal Instruction: 4.

I find this line in " ./dlib/dlib/cmake_utils/set_compiler_specific_options.cmake" ,so change and recomplie , it work!
image

works

from face_recognition.

rakode avatar rakode commented on May 2, 2024

Buenos dias , la libreria face_recognition , confunde personas al identifcar , lo llame falso positivo , para cuando van a resolver este problema . Estoy haciendo un sistema de reconocimiento facial y me gustaria saber para cuando tienen la solucion.

from face_recognition.

listofbanned avatar listofbanned commented on May 2, 2024

Buenos dias , la libreria face_recognition , confunde personas al identifcar , lo llame falso positivo , para cuando van a resolver este problema . Estoy haciendo un sistema de reconocimiento facial y me gustaria saber para cuando tienen la solucion.

Hi!, could you give more details? It always happens? when it happens it's only for a moment or for a long time? is it just one face or many?
Hola!, puedes dar mas detalles? Pasa siempre? cuando pasa es solo por un momento u ocurre por largo rato?, pasa solo con una cara o con muchas?

from face_recognition.

rakode avatar rakode commented on May 2, 2024

from face_recognition.

rakode avatar rakode commented on May 2, 2024

from face_recognition.

sumeetvaidya avatar sumeetvaidya commented on May 2, 2024

I have the issue in MacOS 12.0.1 (M1 chip). Error:
zsh: illegal hardware instruction
installation:
using python 3.7
conda install -c conda-forge dlib
pip install face_recognition

from face_recognition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.