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

點擊他的第一個鏈接,往下滑孵奶,終于出現(xiàn)了我想要的東西


捕獲.PNG

蒼了個天,果斷下載然后以pip方式進行包的安裝--bingo蜡峰!成功了袁!
接著嘗試

pip install face_recognition

bingo! 成功!之后的內(nèi)容可不看湿颅!


華麗分割線

華麗分割線

華麗分割線

華麗分割線


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.

繼續(xù)嘗試安裝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

照做,運行還是報一樣的錯誤秒啦,那就是沒有添加到系統(tǒng)環(huán)境變量
嘗試把它添加到系統(tǒng)環(huán)境變量當中熬粗,運行---沒有之前的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!
最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末驻呐,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子芳来,更是在濱河造成了極大的恐慌含末,老刑警劉巖,帶你破解...
    沈念sama閱讀 207,113評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件即舌,死亡現(xiàn)場離奇詭異佣盒,居然都是意外死亡,警方通過查閱死者的電腦和手機顽聂,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,644評論 2 381
  • 文/潘曉璐 我一進店門肥惭,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人紊搪,你說我怎么就攤上這事蜜葱。” “怎么了耀石?”我有些...
    開封第一講書人閱讀 153,340評論 0 344
  • 文/不壞的土叔 我叫張陵牵囤,是天一觀的道長。 經(jīng)常有香客問我滞伟,道長揭鳞,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,449評論 1 279
  • 正文 為了忘掉前任诗良,我火速辦了婚禮汹桦,結果婚禮上,老公的妹妹穿的比我還像新娘鉴裹。我一直安慰自己舞骆,他們只是感情好,可當我...
    茶點故事閱讀 64,445評論 5 374
  • 文/花漫 我一把揭開白布径荔。 她就那樣靜靜地躺著督禽,像睡著了一般。 火紅的嫁衣襯著肌膚如雪总处。 梳的紋絲不亂的頭發(fā)上狈惫,一...
    開封第一講書人閱讀 49,166評論 1 284
  • 那天,我揣著相機與錄音,去河邊找鬼胧谈。 笑死忆肾,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的菱肖。 我是一名探鬼主播客冈,決...
    沈念sama閱讀 38,442評論 3 401
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼稳强!你這毒婦竟也來了场仲?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 37,105評論 0 261
  • 序言:老撾萬榮一對情侶失蹤退疫,失蹤者是張志新(化名)和其女友劉穎渠缕,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體褒繁,經(jīng)...
    沈念sama閱讀 43,601評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡亦鳞,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,066評論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了澜汤。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片蚜迅。...
    茶點故事閱讀 38,161評論 1 334
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖俊抵,靈堂內(nèi)的尸體忽然破棺而出谁不,到底是詐尸還是另有隱情,我是刑警寧澤徽诲,帶...
    沈念sama閱讀 33,792評論 4 323
  • 正文 年R本政府宣布刹帕,位于F島的核電站,受9級特大地震影響谎替,放射性物質(zhì)發(fā)生泄漏偷溺。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,351評論 3 307
  • 文/蒙蒙 一钱贯、第九天 我趴在偏房一處隱蔽的房頂上張望挫掏。 院中可真熱鬧,春花似錦秩命、人聲如沸尉共。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,352評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽袄友。三九已至,卻和暖如春霹菊,著一層夾襖步出監(jiān)牢的瞬間剧蚣,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,584評論 1 261
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留鸠按,地道東北人礼搁。 一個月前我還...
    沈念sama閱讀 45,618評論 2 355
  • 正文 我出身青樓,卻偏偏與公主長得像目尖,于是被迫代替她去往敵國和親叹坦。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 42,916評論 2 344

推薦閱讀更多精彩內(nèi)容