-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues Using CUDA with Face Recognition on Jetson Nano #1404
Comments
It's little bit late but if you still have problem, try this way:
With jtop command you can see if GPU is in use
and check if output is True Good luck! |
|
Same issue here. Have you found the fix? |
Is it necessary to perform a memory swap? |
I followed the compilation steps, and when I type "print(dlib.DLIB_USE_CUDA)", the response is "TRUE." However, when I attempt to run the code, I receive a "Segmentation fault (core dumped)" error. I followed Paul's steps, and everything worked, but the frames per second (fps) were low, and it wasn't using the GPU. The version of dlib was 19.17. When I tried the more recent versions like 19.24, 19.23, 19.21, I encountered the same "Segmentation fault (core dumped)" message. Paul: Nvidia forum I'm using numpy 1.19.4 |
I have different error when I used face_recognition |
Me too. Have you solved it? |
System Information
Description
Hi all,
For the past week or so, I have been trying to get Face Recognition and Dlib to work with CUDA on the Jetson Nano 4GB. I have attempted multiple installation combinations of Dlib and the Face Recognition library, but none have succeeded in enabling me to use the "cnn" model with the face_locations() function (each failing with different kinds of errors).
Note: In each of the below cases, any problem was exhibited regardless of the image loaded into the face_locations() function. Where Dlib was built from source, the Dlib compilation process always reported that "DLIB WILL USE CUDA". Installations of Dlib that could be successfully imported into Python always returned True and 1 when "dlib.DLIB_USE_CUDA" and "print(dlib.cuda.get_num_devices())" were entered into Python respectively.
Installation Process
Originally, I attempted to install Dlib version 19.22.1 via "pip3 install dlib" (the latest version at the time prior to the release of Dlib version 19.23). I didn't think that I needed to implement the fix in Dlib for Jetson Nano outlined in the "Jetson Nano installation instructions" article in the README, as the problem mentioned in the article had supposedly since been fixed in a past cuDNN/JetPack SDK update. The library downloaded successfully, but attempting to import the library was met with "Segmentation fault (core dumped)". Research suggested that I try downgrading the library to version 19.21.1 and, on doing so (using pip), was able to import the library without issue and use it with face_recognition.
I then tried to use the "cnn" model with the face_locations() function in a simple program to detect the position of a face in an image. Each time I ran the program, the GPU showed 0% usage, and it would either freeze the computer before failing with "Killed" in the terminal (usually after a few minutes), or completely freeze up the entire system, forcing me to perform a hard restart of the computer. Using other face_recognition functions, such as face_encodings() and compare_faces() (for facial recognition), or face_locations() with the default HOG-based model worked without error.
With the release of Dlib 19.23, I uninstalled Dlib 19.21.1 and tried installing Dlib 19.23 using pip, but was also met with "Segmentation fault (core dumped)" on import into Python, as with Dlib 19.22.1. To rule out not building Dlib from source as being an issue, I uninstalled 19.23 and built from source the previously working Dlib 19.21 release (without applying the old cuDNN "forward_algo = forward_best_algo" fix), but the "cnn" model still failed to run.
I then attempted to build 19.23 using NumPy 1.19.4 (instead of version 1.19.5 that was previously installed on my system and used for the above few Dlib installations) and exporting the "OPENBLAS_CORETYPE=ARMV8" environmental variable into the Terminal (suggestions from the internet to fix the "Segmentation fault" on import issue), with no success.
My current installation now consists of a built from source version of Dlib 19.21 (using NumPy 1.19.4), following the instructions to comment out "forward_algo = forward_best_algo" before compiling the package. On running the "cnn" model with face_locations(), the GPU, for the first time, showed GPU usage (99%), before the program crashed 15-20 seconds later with the following error:
Click the arrow to view the full Python Terminal crash output.
If anyone can provide me with some advice on how to proceed, it would be greatly appreciated.
Thank you
The text was updated successfully, but these errors were encountered: