Segmentation fault (core dumped) - dlib and face_recognition

I’m trying to build a facial recognition system, but I’m getting a Segmentation fault (core dumped) error.

Here are the software versions I’m using:

  • numpy 1.19.4
  • OpenCV 4.5.0 (Build)
  • Dlib 19.21
  • Jetpack 4.6
  • CUDA 10.2
  • cuDNN 8.2

I followed all the instructions from Simple accelerated face recognition - #19 by AastaLLL

My code is based on this tutorial: https://www.youtube.com/watch?v=eTf3UtnxMdw&list=PLGs0VKk2DiYxP-ElZ7-QXIERFFPkOuP4_&index=44

I triyed build dlib 19.17 19.21 19.22 19.23 and 19.24. I’m facing the same error.

Hi,

Have you also tried script shared in the Simple accelerated face recognition - #19 by AastaLLL?
Does it work?

Thanks.

Yes!
I built OpenCV following the JetsonHacks tutorial. I followed the instructions provided in Simple accelerated face recognition - #19 by AastaLLL, but I encountered the same issue: “Segmentation fault (core dumped).”

Here are the versions of the software I’m using:

  • numpy 1.19.4
  • OpenCV 4.5.4 (built)
  • Dlib 19.21
  • Jetpack 4.6
  • CUDA 10.2
  • cuDNN 8.2

Now I uninstalled dlib and face recognition and reinstalled following Paul McWhorter’s instructions (without building):

sudo apt-get update
sudo apt-get install cmake libopenblas-dev liblapack-dev libjpeg-dev
sudo apt-get install python3-pip
# Swap memory setup (if applicable)
wget http://dlib.net/files/dlib-19.17.tar.bz2
tar jxvf dlib-19.17.tar.bz2
gedit cudnn-dlibapi.cpp
sudo python3 setup.py install
sudo pip3 install face_recognition

However, even after these steps, I encountered the same issue: “Segmentation fault (core dumped).”

I tried this on another SD card without building OpenCV and dlib. I successfully completed the installation and achieved 13 FPS with the following configurations:

  • OpenCV 4.1.1
  • Dlib 19.24

My CPU usage ranged from 36% to 48%, and my GPU usage fluctuated between 40% and 100%.

Based on my experience, it seems that building OpenCV may not be necessary or could potentially cause conflicts when using the dlib and face_recognition libraries. Can anyone confirm this?

Hi,

A possible cause is that there are multiple OpenCV installed in the environment which leads to this issue.

Do you use CUDA-based OpenCV API?
If not, you don’t need to rebuild the OpenCV from the source.

Thanks.

Part of the problem has been solved. I just put opencv import on the first line and it worked.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.