詳解Windows下源碼編譯PaddlePaddle
Windows 下從源碼編譯 PaddlePaddle
1.環(huán)境準(zhǔn)備
- Windows 10 專業(yè)版 (64bit)
- Python 版本 Python 3.9.16(64 bit)
- Visual Studio2022 專業(yè)版
1.1 cmake
cmake --version
cmake version 3.25.1-msvc1 CMake suite maintained and supported by Kitware (kitware.com/cmake).
1.2 python
(p2) PS D:\Paddle> python --version Python 3.9.16
1.3 cuda
(p2) PS D:\Paddle> nvidia-smi Wed Apr 5 17:06:19 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 516.94 Driver Version: 516.94 CUDA Version: 11.7 |
1.4 python包
(p2) PS D:\Paddle> pip install numpy protobuf wheel ninja Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: numpy in i:\miniconda3\envs\p2\lib\site-packages (1.23.2) Requirement already satisfied: protobuf in i:\miniconda3\envs\p2\lib\site-packages (3.20.3) Requirement already satisfied: wheel in i:\miniconda3\envs\p2\lib\site-packages (0.38.4) Requirement already satisfied: ninja in i:\miniconda3\envs\p2\lib\site-packages (1.11.1)
1.5 創(chuàng)建編譯文件夾
mkdir D:\workspace && cd /d D:\workspace git clone https://github.com/PaddlePaddle/Paddle.git cd Paddle
1.6 啟用visual studio終端
********************************************************************** ** Visual Studio 2022 Developer Command Prompt v17.5.3 ** Copyright (c) 2022 Microsoft Corporation ********************************************************************** C:\Program Files\Microsoft Visual Studio\2022\Professional>d: D:\>cd Paddle D:\Paddle>
1.7 開(kāi)始編譯
先編譯CPU版本吧,因?yàn)镚PU的cuda和cudnn環(huán)境變量不會(huì)寫(xiě)(偷懶用conda安裝的)
cmake .. -GNinja -DWITH_GPU=OFF -DWITH_UNITY_BUILD=ON ninja
編譯過(guò)程中會(huì)下載東西,所以建議不要斷網(wǎng)。 此過(guò)程中:
- 特別費(fèi)CPU,我的到了100%,風(fēng)扇呼呼的;
- 內(nèi)存使用不大,10GB左右沒(méi)變過(guò);
- 不斷使用git下載,所以網(wǎng)速要好。
1.8 docker編譯
docker run --name paddle-test -v 123456:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:latest-dev /bin/bash
3 times. CMake Error at /paddle/build/third_party/dlpack/tmp/extern_dlpack-gitclone.cmake:31 (message): Failed to clone repository: 'https://github.com/dmlc/dlpack.git' CMakeFiles/extern_dlpack.dir/build.make:91: recipe for target 'third_party/dlpack/src/extern_dlpack-stamp/extern_dlpack-download' failed make[2]: *** [third_party/dlpack/src/extern_dlpack-stamp/extern_dlpack-download] Error 1 CMakeFiles/Makefile2:4791: recipe for target 'CMakeFiles/extern_dlpack.dir/all' failed make[1]: *** [CMakeFiles/extern_dlpack.dir/all] Error 2 fatal: unable to access 'https://github.com/JuliaStrings/utf8proc.git/': Failed to connect to github.com port 443: Connection refused -- Had to git clone more than once: 3 times. CMake Error at /paddle/build/third_party/utf8proc/tmp/extern_utf8proc-gitclone.cmake:31 (message): Failed to clone repository: 'https://github.com/JuliaStrings/utf8proc.git' CMakeFiles/extern_utf8proc.dir/build.make:90: recipe for target 'third_party/utf8proc/src/extern_utf8proc-stamp/extern_utf8proc-download' failed make[2]: *** [third_party/utf8proc/src/extern_utf8proc-stamp/extern_utf8proc-download] Error 1 CMakeFiles/Makefile2:4818: recipe for target 'CMakeFiles/extern_utf8proc.dir/all' failed
以上就是詳解Windows下源碼編譯PaddlePaddle的詳細(xì)內(nèi)容,更多關(guān)于Windows編譯PaddlePaddle的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
Python遍歷文件夾和讀寫(xiě)文件的實(shí)現(xiàn)方法
本篇文章主要介紹了Python遍歷文件夾和讀寫(xiě)文件的實(shí)現(xiàn)方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-05-05python使用ctypes調(diào)用第三方庫(kù)時(shí)出現(xiàn)undefined?symbol錯(cuò)誤詳解
python中時(shí)間的庫(kù)有time和datetime,pandas也有提供相應(yīng)的時(shí)間處理函數(shù),下面這篇文章主要給大家介紹了關(guān)于python使用ctypes調(diào)用第三方庫(kù)時(shí)出現(xiàn)undefined?symbol錯(cuò)誤的相關(guān)資料,需要的朋友可以參考下2023-02-02跟老齊學(xué)Python之類(lèi)的細(xì)節(jié)
前面對(duì)類(lèi)的有關(guān)內(nèi)容已經(jīng)描述不少了,其實(shí)話題遠(yuǎn)遠(yuǎn)沒(méi)有結(jié)束,不過(guò)對(duì)于初學(xué)者,掌握這些已經(jīng)算是入門(mén),在以后的實(shí)踐中,還需要進(jìn)行體會(huì)和感悟。2014-10-10python?如何實(shí)現(xiàn)跳過(guò)異常繼續(xù)執(zhí)行
這篇文章主要介紹了python?如何實(shí)現(xiàn)跳過(guò)異常繼續(xù)執(zhí)行,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-07-07在Python中使用Neo4j數(shù)據(jù)庫(kù)的教程
這篇文章主要介紹了在Python中使用Neo4j數(shù)據(jù)庫(kù)的教程,Neo4j是一個(gè)具有一定人氣的非關(guān)系型的數(shù)據(jù)庫(kù),需要的朋友可以參考下2015-04-04Python OpenCV對(duì)本地視頻文件進(jìn)行分幀保存的實(shí)例
今天小編就為大家分享一篇Python OpenCV對(duì)本地視頻文件進(jìn)行分幀保存的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-01-01python把ipynb文件轉(zhuǎn)換成pdf文件過(guò)程詳解
這篇文章主要介紹了用python把ipynb文件轉(zhuǎn)換成pdf文件過(guò)程詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-07-07