question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't run process dlib in GPU

See original GitHub issue
  • face_recognition version: 1.2.3
  • Python version:2.7
  • Operating System:ubuntu16.04

Description

Hello, i’m tryng to running python code where the code run face_recognition library where is GPU required to run faster for dlib face_recognition run model CNN

i’m using NVIDIA GPU Cloud Image for Deep Learning and HPC to run the python script, then the python script main.py :

from PIL import Image
    import face_recognition
    from datetime import datetime
    
    start=datetime.now()
    # Load the jpg file into a numpy array
    image = face_recognition.load_image_file("com.jpg")
    
    face_locations = face_recognition.face_locations(image, number_of_times_to_upsample=0, model="cnn")
    face_encode = face_recognition.face_encodings(image, face_locations)
    
    
    print("I found {} face(s) in this photograph.".format(len(face_locations)))
    
    print(face_encode)
    
    
    print(datetime.now()-start)

here the driver of NVIDIA from nvidia-smi driver version 396.44 : https://i.stack.imgur.com/OY2eq.png

i have installed CUDA-Toolkit 9.2 and CUDNN, here the log when installed the dlib with GPU support: there have support CUDA will used for dlib https://i.stack.imgur.com/XrP7a.png

then i try to run the code main.py, but the process not running on NVIDIA GPU took 01:06.114585 any idea for this problem ? https://i.stack.imgur.com/bD9xR.png

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
lkabongoCScommented, May 3, 2019

i installed dlib first with pip then with sudo python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA are that possible python use dlib from pip version not from python setup.py ? i’m try installed like this step: $ git clone https://github.com/davisking/dlib.git $ cd dlib $ mkdir build $ cd build $ cmake … -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1 $ cmake --build . $ cd … $ python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA

  • note i got successfull running on GPU, the problem is when making cmake --build . it’s on python3 but i think dlib installed on python2. my bad. Thank You

–yes is deprecated is there any other way to build ??

python setup.py install --set DLIB_USE_CUDA=1 --set USE_AVX_INSTRUCTIONS=1

1reaction
Datapirate-98commented, Apr 20, 2020

how to install dlib with cuda support please provide the steps and which version of cuda supports the library plsss help… it will be a graet help to the developers community

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check if dlib is using GPU or not? - Stack Overflow
Easiest way to check it is to check if dlib recognizes your GPU. import dlib.cuda as cuda print(cuda.get_num_devices()). If the number of ...
Read more >
Installing Dlib for Python - Everything under three dimension
Installing Dlib for Python · Step 1: Upgrade Nvidia GPU Drivers · Step 2: Install Visual Studio and Visual Studio Build Tools (2019,...
Read more >
Installing dlib with Nvidia Cuda & cudnn on Ubuntu ... - YouTube
This video is all you need to install DLib with Nvidia CUDA and cudNN support in your Python 3.x installation created using Conda....
Read more >
How to install dlib - PyImageSearch
The dlib library doesn't have any real Python prerequisites, but if you plan on using dlib for any type of computer vision or...
Read more >
Installing dlib with python3.6 in Jetson Nano
After issuing command : pip3 install dlib. It keeps on building wheel for dlib. ... Not able to run face recognition on GPU...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found