刚才第一次碰了一下这个美颜算法,要用dlib ,dlib 还挺折腾人啊
除了C++环境,还得安装 cmake 和 boosting (好像是这个来着)
最后编译也要了好几分钟hhh
问题如下:
运行
>>> import dlib
Traceback (most recent call last):
File "xxxxx.py", line 1, in <module>
import dlib
File "xxxxx\lib\site-packages\dlib\__init__.py", line 21, in <module>
add_lib_to_dll_path('C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib/cudnn.lib')
File "xxxxx\lib\site-packages\dlib\__init__.py", line 11, in add_lib_to_dll_path
os.add_dll_directory(os.path.join(os.path.dirname(path), '../../bin'))
File "xxxxx\lib\os.py", line 1109, in add_dll_directory
cookie = nt._add_dll_directory(path)
FileNotFoundError: [WinError 2] The system cannot find the file specified : 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib\\../../bin'
FileNotFoundError: [WinError 2] 系统找不到指定的文件。 : 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/lib\\../../bin'
查看那个报错文件: 把那个文件改一下:
except (AttributeError,KeyError):
pass
改成:
except (AttributeError, KeyError, FileNotFoundError):
pass
加个FileNotFoundError 就OK了
已经再github上留下了issue https://github.com/davisking/dlib/pull/2515
|