dlib安装的那些破事

重要更新:

在很多尝试之后无果后,我相信是我的人品问题。今天突然看到一篇文章,解决我的问题
文章地址
其中有个帅哥的回答是这样的:

Just go to this page and dowload the Python Wheel file and just pip install it. Or if you want a pre-python 3.6 build you want download it here.

pip install dlib-file.whl

点击他的第一个链接,往下滑,终于出现了我想要的东西


捕获.PNG

苍了个天,果断下载然后以pip方式进行包的安装--bingo!成功!
接着尝试

pip install face_recognition

bingo! 成功!之后的内容可不看!


华丽分割线

华丽分割线

华丽分割线

华丽分割线


1.cmake

1.PNG

地址:https://cmake.org/download/

@PBShortStop Installation of CMake in windows is very simple just grab the installation file (*.msi) from this link and install it. Remember to check the "Add CMake to system path" during the installation. Then you can simply use cmake --version in command prompt.

继续尝试安装dlib,shit! 不行
在命令行中尝试了一下cmake指令,并没有报错!
尝试下载dlib离线未编译版,再编译,运行过程中抛错误

CMake Error at CMakeLists.txt:5 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:5 (project):
No CMAKE_CXX_COMPILER could be found.

错误信息大概如上所示,找解决办法:看到一篇文章
给出的解决办法如下所示

查看文件buile/CMakeFiles/CMakeError.log
报错如下:
LINK : fatal error LNK1158: cannot run 'rc.exe'
解决方法:
1.进入目录C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
2.拷贝文件:RC.Exe 和 RcDll.Dll
3.放到从CMakeError.log文件中看到的链接目录下,比如:F:\VS\VC\bin

照做,运行还是报一样的错误,那就是没有添加到系统环境变量
尝试把它添加到系统环境变量当中,运行---没有之前的cmake error了

忘了,之前有一个编译boost的过程,boost的下载地址如下

https://sourceforge.net/projects/boost/files/boost-binaries/

注意事项下载的boost版本要和MSVC编译器适配


华丽分割线


以上Windows安装dlib的指导主要遵循以下知道
原文地址

Hi,
I've successfully installed and tested this tool on my windows 10 machine and I'm writing a simple procedure to install it. It may be useful for some people try to use this tool on a Windows machine.
IMPORTANT: Actually this project has made for Linux systems and especially dlib. In my tests, the performance of this tool in Windows 10 was about a quarter in comparison with Ubuntu built with the same specs. But I haven't seen any difference between these two in other subjects.
Requirments:
(I've used this tutorial with these tools installed on Windows 10 but the newer version may work too.)

  1. Microsoft Visual Studio 2015 with C/C++ Compiler installed. (Visual C++ 2015 Build Tools didn't work for me and I got into problems in compiling dlib)
  2. Boost library version 1.63 or newer. Also, you can use precompiled binaries for specific MSVC you have but I don't suggest. (I've included the compiling procedure of Boost in this tutorial)
  3. Of course Python3 (I used Python3.5 x64 but I think the other versions would work too)
  4. CMake for windows and add it to your system environment variables.
    Installation:
  5. Download and install scipy and numpy+mkl (must be mkl version) packages from this link (all credits goes to Christoph Gohlke). Remember to grab correct version based on your current Python version.
  6. Download Boost library source code or binary release for your current MSVC from this link.
  7. If you downloaded the binary version skip to step 4 else follow these steps to compile and build Boostby yourself:
    3-1. Extract the Boost source files into C:\local\boost_1_XX_X (X means the current version of Boostyou have)
    3-2. Create a system variable with these parameters:
    Name: VS140COMNTOOLS
    Value: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ (or any path where you have installed MSVC)
    3-3. Open Developer Command Prompt for Visual Studio and go to the current directory of Boostextracted and try these commands to compile Boost:
    bootstrap
    b2 -a --with-python address-model=64 toolset=msvc runtime-link=static
    3-4. If you successfully compile Boost, it should create compiled files in stage directory.
  8. (If you have already compiled Boost skip this step) If you already download the binary release just extract the contents to C:\local\boost_1_XX_X
  9. Grab latest version of dlib from this repo and extract it.
  10. Go to dlibdirectory and open cmd and follow these commands to build dlib: (remember to replace XX with current version of Boost you have)
    set BOOST_ROOT=C:\local\boost_X_XX_X
    set BOOST_LIBRARYDIR=C:\local\boost_X_XX_X\stage\lib
    python setup.py install --yes USE_AVX_INSTRUCTIONS or python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA
  11. Now you can use import dlib without any problem into your python script.
  12. You can also check the current version of dlib with pip show dlib.
  13. Now simply install face_recognition with pip install face_recognition.
  14. Enjoy!
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,847评论 4 362
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,208评论 1 292
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,587评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,942评论 0 205
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,332评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,587评论 1 218
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,853评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,568评论 0 198
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,273评论 1 242
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,542评论 2 246
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,033评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,373评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,031评论 3 236
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,073评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,830评论 0 195
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,628评论 2 274
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,537评论 2 269

推荐阅读更多精彩内容