飞桨PaddlePaddle安装

PaddlePaddle是百度开源的深度学习平台,英文名称为PaddlePaddle,中文名为飞桨。它是基于百度多年的深度学习技术研究和业务应用所开发,集成了深度学习核心框架、基础模型库、端到端开发套件、工具组件和服务平台于一体。

在现有环境中安装paddle

环境中需要提前安装好cuda和cudnn,可以直接用nvidia官方的镜像

1.环境准备

1.1.如何查看您的环境

可以使用以下命令查看本机的操作系统和位数信息:

bash 复制代码
uname -m && cat /etc/*release

确认需要安装 PaddlePaddle 的 Python 是您预期的位置,因为您计算机可能有多个 Python

根据您的环境您可能需要将说明中所有命令行中的 python3 替换为具体的 Python 路径

bash 复制代码
which python3

需要确认 python 的版本是否满足要求

使用以下命令确认是 3.8/3.9/3.10/3.11/3.12

bash 复制代码
python3 --version

需要确认 pip 的版本是否满足要求,要求 pip 版本为 20.2.2 或更高版本

bash 复制代码
python3 -m ensurepip
bash 复制代码
python3 -m pip --version

需要确认 Python 和 pip 是 64bit,并且处理器架构是 x86_64(或称作 x64、Intel 64、AMD64)架构。下面的第一行输出的是"64bit",第二行输出的是"x86_64"、"x64"或"AMD64"即可:

bash 复制代码
python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

2.开始安装

2.1.CPU 版的 PaddlePaddle

bash 复制代码
python3 -m pip install paddlepaddle==2.6.1 -i https://mirror.baidu.com/pypi/simple

2.2.GPU 版的 PaddlePaddle

2.2.1.CUDA11.2 的 PaddlePaddle

bash 复制代码
python3 -m pip install paddlepaddle-gpu==2.6.1.post112 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

2.2.2.CUDA11.6 的 PaddlePaddle

bash 复制代码
python3 -m pip install paddlepaddle-gpu==2.6.1.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

2.2.3.CUDA11.8 的 PaddlePaddle

bash 复制代码
python3 -m pip install paddlepaddle-gpu==2.6.1 -i https://mirror.baidu.com/pypi/simple

2.2.4.CUDA12.0 的 PaddlePaddle

bash 复制代码
python3 -m pip install paddlepaddle-gpu==2.6.1.post120 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

3.验证安装

安装完成后您可以使用 python3 进入 python 解释器,输入import paddle ,再输入 paddle.utils.run_check()

如果出现PaddlePaddle is installed successfully!,说明您已成功安装。

python 复制代码
Python 3.8.19 (default, Mar 20 2024, 19:58:24) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
python 复制代码
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ... 
I0524 02:49:29.605748  9796 program_interpreter.cc:212] New Executor is Running.
W0524 02:49:29.607050  9796 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:29.613905  9796 gpu_resources.cc:164] device: 0, cuDNN Version: 8.2.
I0524 02:49:32.302078  9796 interpreter_util.cc:624] Standalone Executor is Used.
PaddlePaddle works well on 1 GPU.
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='0', default_value='')
=======================================================================
I0524 02:49:33.759387  9875 tcp_utils.cc:181] The server starts to listen on IP_ANY:57410
I0524 02:49:33.759631  9875 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='4', default_value='')
=======================================================================
I0524 02:49:34.278539  9888 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
I0524 02:49:34.292114  9888 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
W0524 02:49:34.298468  9888 gpu_resources.cc:119] Please NOTE: device: 4, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.305361  9888 gpu_resources.cc:164] device: 4, cuDNN Version: 8.2.
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='5', default_value='')
=======================================================================
I0524 02:49:34.392978  9897 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
I0524 02:49:34.393196  9897 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
W0524 02:49:34.405627  9897 gpu_resources.cc:119] Please NOTE: device: 5, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.411123  9897 gpu_resources.cc:164] device: 5, cuDNN Version: 8.2.
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='2', default_value='')
=======================================================================
I0524 02:49:34.436482  9879 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
I0524 02:49:34.473301  9879 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='1', default_value='')
=======================================================================
I0524 02:49:34.474831  9877 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
I0524 02:49:34.475021  9877 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
W0524 02:49:34.481299  9877 gpu_resources.cc:119] Please NOTE: device: 1, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.482425  9879 gpu_resources.cc:119] Please NOTE: device: 2, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.485813  9877 gpu_resources.cc:164] device: 1, cuDNN Version: 8.2.
W0524 02:49:34.490847  9879 gpu_resources.cc:164] device: 2, cuDNN Version: 8.2.
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='3', default_value='')
=======================================================================
I0524 02:49:34.505313  9885 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='7', default_value='')
=======================================================================
I0524 02:49:34.532421  9913 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
I0524 02:49:34.575191  9885 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
I0524 02:49:34.575328  9913 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
W0524 02:49:34.591156  9913 gpu_resources.cc:119] Please NOTE: device: 7, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.594236  9885 gpu_resources.cc:119] Please NOTE: device: 3, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.598922  9913 gpu_resources.cc:164] device: 7, cuDNN Version: 8.2.
W0524 02:49:34.604974  9885 gpu_resources.cc:164] device: 3, cuDNN Version: 8.2.
======================= Modified FLAGS detected =======================
FLAGS(name='FLAGS_selected_gpus', current_value='6', default_value='')
=======================================================================
I0524 02:49:34.614703  9903 tcp_utils.cc:130] Successfully connected to 127.0.0.1:57410
I0524 02:49:34.624086  9903 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
I0524 02:49:34.664119  9875 process_group_nccl.cc:129] ProcessGroupNCCL pg_timeout_ 1800000
W0524 02:49:34.665885  9903 gpu_resources.cc:119] Please NOTE: device: 6, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.677251  9903 gpu_resources.cc:164] device: 6, cuDNN Version: 8.2.
W0524 02:49:34.716320  9875 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.4, Runtime API Version: 11.4
W0524 02:49:34.727599  9875 gpu_resources.cc:164] device: 0, cuDNN Version: 8.2.
I0524 02:49:40.253692  9879 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.255170  9885 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.280423  9877 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.288800  9913 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.300041  9903 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.301714  9875 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.323594  9888 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.349901  9897 process_group_nccl.cc:132] ProcessGroupNCCL destruct 
I0524 02:49:40.728493  9980 tcp_store.cc:289] receive shutdown event and so quit from MasterDaemon run loop
PaddlePaddle works well on 8 GPUs.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
相关推荐
赛逸展张胜7 分钟前
CES Asia是一个关于什么的展会?
大数据·人工智能·科技
Coovally AI模型快速验证36 分钟前
YOLO11全解析:从原理到实战,全流程体验下一代目标检测
人工智能·yolo·目标检测·机器学习·计算机视觉·目标跟踪·yolo11
是Dream呀1 小时前
WHAT KAN I SAY?Kolmogorov-Arnold Network (KAN)网络结构介绍及实战(文末送书)
深度学习·神经网络·kan
湫ccc1 小时前
《Opencv》基础操作详解(2)
人工智能·opencv·计算机视觉
羑悻的小杀马特1 小时前
【AIGC篇】畅谈游戏开发设计中AIGC所发挥的不可或缺的作用
c++·人工智能·aigc·游戏开发
火山方舟1 小时前
解密!企业级智能客服高效运营的秘密武器 | 大模型流程设计与Prompt模版
前端·人工智能·稀土
CES_Asia1 小时前
国资助力科技创新,闪耀CES Asia 2025
人工智能·科技·智能手机·智能音箱·智能电视
eric-sjq2 小时前
基于xiaothink对Wanyv-50M模型进行c-eval评估
人工智能·python·语言模型·自然语言处理·github
是十一月末2 小时前
机器学习之KNN算法预测数据和数据可视化
人工智能·python·算法·机器学习·信息可视化
工业互联网专业2 小时前
基于OpenCV和Python的人脸识别系统_django
人工智能·python·opencv·django·毕业设计·源码·课程设计