Support for CUDA is ALWAYS on the way.
-
Download
.whl
files form Releases -
Install
pip install dlib-XX.XX.X-cpXX-cpXX-win_amd64.whl
The
XX
depends on your situation.
Open file C:\Users\XXX\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\dlib\_init_.py
.
The XXX
depends on your situation and the whole filepath may be different based on your installation configuration.
If you use CUDA, configure the code:
if "ON" == "ON":
add_lib_to_dll_path(
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudnn.lib"
)
add_lib_to_dll_path(
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudart.lib"
)
The XX.X
depends on your situation or the whole filepath may be different based on your installation configuration.
If you do not use CUDA, delete the code:
if "ON" == "ON":
add_lib_to_dll_path(
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudnn.lib"
)
add_lib_to_dll_path(
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.X/lib/x64/cudart.lib"
)
Probably. I have not tried it.
import dlib
print(dlib.DLIB_USE_CUDA)
print(dlib.cuda.get_num_devices())
Or
Run the tempCodeRunnerFile.py
.
Whether the .whl
file works on your computer is a matter of luck!
If the .whl
file smooths your installation, you could send an email of gratitude to me. This is enough to delight me for not less than a day and makes you incredibly sexually attractive.
If it does not work, please make an attempt at the following steps.
-
Try to install different versions of
.whl
files on the Release page. -
Try
.whl
files on Dlib_Windows_Python3.x. -
Download the source code from dlib (official) and install it by yourself.
By the way, you could also send an email to me to complain.
Note
My email address is shown on my GitHub profile.
The installation of cuDNN greater than 9.0.0 may cause weird errors. Please check out the issue davisking/dlib#2979.
The following steps may work:
-
Move files from subfolders to parent folders.
- Move all files from
C:\Program Files\NVIDIA\CUDNN\vx.x\bin\xx.x
toC:\Program Files\NVIDIA\CUDNN\vx.x\bin
- Move all files from
C:\Program Files\NVIDIA\CUDNN\vx.x\include\xx.x
toC:\Program Files\NVIDIA\CUDNN\vx.x\inlcude
- Move all files from
C:\Program Files\NVIDIA\CUDNN\vx.x\lib\xx.x
toC:\Program Files\NVIDIA\CUDNN\vx.x\lib
- Move all files from
-
Add the system variable
CMAKE_PRIFIX_PATH
whose value isC:/Program Files/NVIDIA/CUDNN/vx.x
.