Dlib: CPU version of recognition

Created on 2 Aug 2017  路  4Comments  路  Source: davisking/dlib

Hi @davisking

Is it possible to get CPU version of face recognition working...? I mean if I compile dLib CPU only will I be able to get recognition working?

Srikanth

Most helpful comment

@srikanthreddybethi , All Dlib's algorithms are working on CPU without any changes. When you are compiling Dlib, it searches for CUDA libraries. If they are found - they will be used, if not - everything in DNN will work on CPU (so CPU/GPU choise is done not at runtime, but at compile time)

You can expicitly disable CUDA support, but passing -DDLIB_USE_CUDA=OFF
cmake .. -DDLIB_USE_CUDA=OFF

The simpliest solution - remove CUDA libraries when compiling :)

Also, make sure you have some BLAS libraries installed (OpenBLAS/MKL) to make DNN work fast on CPU

All 4 comments

@davisking the reason why I am asking is I want to use AWS for recognition and it would be too expensive to use GPU instance.... just for recognition using CPU would be much cheaper option.. obviously I do not know performance consequences of using CPU version of dlib dnn for face recognition.

alternately do you have any suggestions for it?

@srikanthreddybethi , All Dlib's algorithms are working on CPU without any changes. When you are compiling Dlib, it searches for CUDA libraries. If they are found - they will be used, if not - everything in DNN will work on CPU (so CPU/GPU choise is done not at runtime, but at compile time)

You can expicitly disable CUDA support, but passing -DDLIB_USE_CUDA=OFF
cmake .. -DDLIB_USE_CUDA=OFF

The simpliest solution - remove CUDA libraries when compiling :)

Also, make sure you have some BLAS libraries installed (OpenBLAS/MKL) to make DNN work fast on CPU

many thanks @e-fominov

@e-fominov
Hi I want to ask how can I close GPU while compiling python API?

Was this page helpful?
0 / 5 - 0 ratings