我已经创建了一个conda虚拟环境来运行具有gpu支持的dlib,在其中我安装了pip install cmake
和conda install cudatoolkit cudnn
的cmake,CUDA和cuDNN,之后我尝试运行dlibs setup.py。从站点下载的文件夹python setup.py install --set DLIB_USE_CUDA=1 --set USE_AVX_INSTRUCTIONS=1
中下载,但未检测到任何cuda安装,如该过程的以下部分所示:
Invoking CMake setup: 'cmake /home/gustavostahl/Downloads/dlib-19.19/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/gustavostahl/Downloads/dlib-19.19/build/lib.linux-x86_64-3.7 -DPYTHON_EXECUTABLE=/home/gustavostahl/anaconda3/envs/dlib_gpu/bin/python -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1 -DCMAKE_BUILD_TYPE=Release'
-- pybind11 v2.2.2
-- Using CMake version: 3.16.3
-- Compiling dlib version: 19.19.0
-- SSE4 instructions can be executed by the host processor.
-- AVX instructions can be executed by the host processor.
-- Enabling AVX instructions
-- Searching for BLAS and LAPACK
-- Searching for BLAS and LAPACK
-- Checking for module 'cblas'
-- No package 'cblas' found
-- Found OpenBLAS library
-- Using OpenBLAS's built in LAPACK
-- Could NOT find CUDA: Found unsuitable version ".", but required is at least "7.5" (found /home/gustavostahl/anaconda3/envs/dlib_gpu/conda-meta)
-- DID NOT FIND CUDA
-- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA
-- C++11 activated.
我的计划是在GPU中运行dlib.train_shape_predictor
以加快训练时间