Open sxyzzzzzzz opened 6 years ago
cpu 100%,then segmentation fault. raspberry pi 3.
seems to freeze the function "face_encodings"
Do you found a solution for this?
Any solution found for this? Been debugging for many hours now to no avail.
Have you found the solution? I met the same problem
Unfortunately I never found a solution to this, besides using some faster hardware. I'd love to hear if others have figured this out, though!
I was experiencing the same problem, segmentation fault when calling the face_encodings
on the raspberry pi 3. In my case, I compiled dlib with OpenBLAS for linear algebra optimizations which allows dlib functionality to execute faster. However, OpenBLAS itself is multi-threaded and if you try and use it in a muilt-threaded application it will peg the CPU and cause the seg fault. For use in multi-threaded applications, OpenBlas recommends you set it to single thread mode.
In my case, I set some environmental variables in my virtual environment to tell OpenBLAS to only use a single thread by doing the following:
$ workon myvenv
$ nano VIRTUAL_ENV/bin/postactivate
add the following lines and save:
export OPENBLAS_NUM_THREADS=1
export OPENBLAS_MAIN_FREE=1
By doing this, I was able to achieve ~15 fps of facial recognition in my application that was previously crashing on my pi.
I was experiencing the same problem, segmentation fault when calling the
face_encodings
on the raspberry pi 3. In my case, I compiled dlib with OpenBLAS for linear algebra optimizations which allows dlib functionality to execute faster. However, OpenBLAS itself is multi-threaded and if you try and use it in a muilt-threaded application it will peg the CPU and cause the seg fault. For use in multi-threaded applications, OpenBlas recommends you set it to single thread mode.In my case, I set some environmental variables in my virtual environment to tell OpenBLAS to only use a single thread by doing the following:
$ workon myvenv
$ nano VIRTUAL_ENV/bin/postactivate
add the following lines and save:
export OPENBLAS_NUM_THREADS=1
export OPENBLAS_MAIN_FREE=1
By doing this, I was able to achieve ~15 fps of facial recognition in my application that was previously crashing on my pi.
This solved my issue too. The Pi is now using only one CPU core instead of 4 but does not crash when calling face_encodings! Any idea how all 4 cores could be used to increase the FPS?
I have the same issue, but I'm not working within a virtual environment, so where would i write
export OPENBLAS_NUM_THREADS=1
export OPENBLAS_MAIN_FREE=1
to?
python facerec_on_raspberry_pi.py
segmentation fault