Windows下源码编译PaddlePaddle的方法是什么
短信预约 -IT技能 免费直播动态提醒
今天小编给大家分享一下Windows下源码编译PaddlePaddle的方法是什么的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。
1.环境准备
Windows 10 专业版 (64bit)
Python 版本 Python 3.9.16(64 bit)
Visual Studio2022 专业版
1.1 cmake
cmake --version
cmake version 3.25.1-msvc1CMake suite maintained and supported by Kitware (kitware.com/cmake).
1.2 python
(p2) PS D:\Paddle> python --versionPython 3.9.16
1.3 cuda
(p2) PS D:\Paddle> nvidia-smiWed 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 ninjaLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simpleRequirement 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 创建编译文件夹
mkdir D:\workspace && cd /d D:\workspacegit clone https://github.com/PaddlePaddle/Paddle.gitcd 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 PaddleD:\Paddle>
1.7 开始编译
先编译CPU版本吧,因为GPU的cuda和cudnn环境变量不会写(偷懒用conda安装的)
cmake .. -GNinja -DWITH_GPU=OFF -DWITH_UNITY_BUILD=ONninja
编译过程中会下载东西,所以建议不要断网。 此过程中:
特别费CPU,我的到了100%,风扇呼呼的;
内存使用不大,10GB左右没变过;
不断使用git下载,所以网速要好。
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/class="lazy" data-src/extern_dlpack-stamp/extern_dlpack-download' failedmake[2]: *** [third_party/dlpack/class="lazy" data-src/extern_dlpack-stamp/extern_dlpack-download] Error 1CMakeFiles/Makefile2:4791: recipe for target 'CMakeFiles/extern_dlpack.dir/all' failedmake[1]: *** [CMakeFiles/extern_dlpack.dir/all] Error 2fatal: 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/class="lazy" data-src/extern_utf8proc-stamp/extern_utf8proc-download' failedmake[2]: *** [third_party/utf8proc/class="lazy" data-src/extern_utf8proc-stamp/extern_utf8proc-download] Error 1CMakeFiles/Makefile2:4818: recipe for target 'CMakeFiles/extern_utf8proc.dir/all' failed
以上就是“Windows下源码编译PaddlePaddle的方法是什么”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注编程网行业资讯频道。
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341