padlepadle下载安装教程
AI摘要
leondoo.com
1
paddle
CPU镜像
CUDA 11.7
GPU镜像
创建名为paddle的环境
激活环境
(paddle.utils.run_check())
10
1
7
CPU版本
CPU版本:适用于无NVIDIA显卡的计算机。 bash python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple ``` ``` GPU版本:需确保CUDA与cuDNN版本匹配。例如,CUDA 11.6对应令: bash python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html ``` ```
CPU版本:适用于无NVIDIA显卡的计算机。 bash python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple ``` ```
CUDA版本不兼容 CUDA驱动版本,并通过官网查询PaddlePaddle支持的CUDA版本范围7。 重新安装匹配的GPU版本,例如: bash p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7 ``` ```
CUDA版本不兼容
Conda安装 使用清华源加速下载: bash conda install paddlepaddle --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ ``` ```
Conda安装
Docker安装(环境隔离) 拉取镜像: bash docker pull paddlepaddle/paddle:latest CPU镜像 docker pull paddlepaddle/paddle:latest-gpu GPU镜像 ``` ``` 启动容器: bash docker run -it --name paddle paddlepaddle/paddle:latest ``` ```
Docker安装(环境隔离)
Docker容器启动失败 确保已安装NVIDIA Container Toolkit(GPU版本)。 镜像与宿主机CUDA版本是否一致。
Docker容器启动失败
GPU支持
GPU支持:若使用GPU版本,需提前安装NVIDIA显卡驱动(CUDA 11.0~12.0)及对应cuDNN库7。
GPU版本
GPU版本:需确保CUDA与cuDNN版本匹配。例如,CUDA 11.6对应令: bash python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html ``` ```
PaddlePaddle下载安装教程
PaddlePaddle提供多种安装方式,可根据需求选择:
Python版本
Python版本:推荐Python 3.8/3.9/3.10/3.11/3.12,需确保p版本≥20.2.2。
Windows系统
Windows系统:仅支持CPU和单卡GPU模式,不支持NCCL多卡训练7。 macOS系统:仅支持CPU版本,且需通过p安装。 产化平台:飞桨提供针对鲲鹏、昇腾等产芯片的编译支持,需从源码构建。
Windows系统:仅支持CPU和单卡GPU模式,不支持NCCL多卡训练7。
``` ```
bash conda create -n paddle python=3.8 创建名为paddle的环境 conda activate paddle 激活环境 ``` ```
bash conda install paddlepaddle --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ ``` ```
bash docker pull paddlepaddle/paddle:latest CPU镜像 docker pull paddlepaddle/paddle:latest-gpu GPU镜像 ``` ```
bash docker run -it --name paddle paddlepaddle/paddle:latest ``` ```
bash p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle ``` ```
bash p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7 ``` ```
bash p install paddleslim ``` ```
bash p install paddlex ``` ```
bash python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple ``` ```
bash python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html ``` ```
bash
bash
conda activate paddle 激活环境
conda activate paddle
conda create -n paddle python=3.8 创建名为paddle的环境 conda activate paddle 激活环境 ``` ```
conda create -n paddle python=3.8 创建名为paddle的环境
conda create -n paddle python=3.8
conda install paddlepaddle --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ ``` ```
conda install paddlepaddle --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
docker pull paddlepaddle/paddle:latest CPU镜像 docker pull paddlepaddle/paddle:latest-gpu GPU镜像 ``` ```
docker pull paddlepaddle/paddle:latest CPU镜像
docker pull paddlepaddle/paddle:latest
docker pull paddlepaddle/paddle:latest-gpu GPU镜像
docker pull paddlepaddle/paddle:latest-gpu
docker run -it --name paddle paddlepaddle/paddle:latest ``` ```
docker run -it --name paddle paddlepaddle/paddle:latest
import paddle print(paddle.utils.run_check())
import paddle
import
macOS系统
macOS系统:仅支持CPU版本,且需通过p安装。
p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle ``` ```
p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle
p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7 ``` ```
p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7
p install paddlepaddle-gpu==2.4.2.post117
p install paddleslim ``` ```
p install paddleslim
p install paddlex ``` ```
p install paddlex
p安装(推荐) CPU版本:适用于无NVIDIA显卡的计算机。 bash python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple ``` ``` GPU版本:需确保CUDA与cuDNN版本匹配。例如,CUDA 11.6对应令: bash python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html ``` ``` Conda安装 使用清华源加速下载: bash conda install paddlepaddle --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ ``` ``` Docker安装(环境隔离) 拉取镜像: bash docker pull paddlepaddle/paddle:latest CPU镜像 docker pull paddlepaddle/paddle:latest-gpu GPU镜像 ``` ``` 启动容器: bash docker run -it --name paddle paddlepaddle/paddle:latest ``` ``` 源码编译(高级用户) 适用于定制化需求,需提前安装CMake、GCC等工具,具体步骤参考文档。
p安装(推荐) CPU版本:适用于无NVIDIA显卡的计算机。 bash python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple ``` ``` GPU版本:需确保CUDA与cuDNN版本匹配。例如,CUDA 11.6对应令: bash python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html ``` ```
p安装(推荐)
print(paddle.utils.run_check())
python import paddle print(paddle.utils.run_check())
python
python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple ``` ```
python -m p install paddlepaddle -i https://mirror.baidu.com/py/simple
python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html ``` ```
python -m p install paddlepaddle-gpu==2.4.2.post116 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/x/stable.html
python
一、环境准备
三、安装验证
二、安装方式详解
五、进阶配置
使用内镜像源(如清华源、源)加速下载。 示例: bash p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle ``` ```
使用内镜像源(如清华源、源)加速下载。
六、平台兼容性说明
启动容器: bash docker run -it --name paddle paddlepaddle/paddle:latest ``` ```
哈希校验错误(Hash miatch) 通常因中断导致文件未完整下载,重新执行安装令即可10。
哈希校验错误(Hash miatch)
四、常见问题与解决
产化平台
产化平台:飞桨提供针对鲲鹏、昇腾等产芯片的编译支持,需从源码构建。
在PyCharm或VS Code中,选择已安装PaddlePaddle的Python解释器路径。
处理器架构
处理器架构:需为x86_64架构,暂不支持ARM架构。
多卡训练支持 安装NCCL库(版本≥2.4.7),并在代码中启用分布式模式。 集成开发环境(IDE)配置 在PyCharm或VS Code中,选择已安装PaddlePaddle的Python解释器路径。 辅助工具安装 安装PaddleX(模型训练工具包): bash p install paddlex ``` ``` 安装PaddleSlim(模型压缩工具): bash p install paddleslim ``` ```
多卡训练支持 安装NCCL库(版本≥2.4.7),并在代码中启用分布式模式。
多卡训练支持
安装NCCL库(版本≥2.4.7),并在代码中启用分布式模式。
安装PaddleSlim(模型压缩工具): bash p install paddleslim ``` ```
安装PaddleX(模型训练工具包): bash p install paddlex ``` ``` 安装PaddleSlim(模型压缩工具): bash p install paddleslim ``` ```
安装PaddleX(模型训练工具包): bash p install paddlex ``` ```
安装完成后,通过Python脚本验证环境是否正常:
拉取镜像: bash docker pull paddlepaddle/paddle:latest CPU镜像 docker pull paddlepaddle/paddle:latest-gpu GPU镜像 ``` ``` 启动容器: bash docker run -it --name paddle paddlepaddle/paddle:latest ``` ```
拉取镜像: bash docker pull paddlepaddle/paddle:latest CPU镜像 docker pull paddlepaddle/paddle:latest-gpu GPU镜像 ``` ```
操作系统与硬件要求 支持系统:Windows 7/10、Ubuntu 18.04/20.04、CentOS 7、macOS(仅支持CPU版本)。 处理器架构:需为x86_64架构,暂不支持ARM架构。 Python版本:推荐Python 3.8/3.9/3.10/3.11/3.12,需确保p版本≥20.2.2。 GPU支持:若使用GPU版本,需提前安装NVIDIA显卡驱动(CUDA 11.0~12.0)及对应cuDNN库7。 虚拟环境配置(可选) 为依赖冲突,建议通过Anaconda创建独立环境: bash conda create -n paddle python=3.8 创建名为paddle的环境 conda activate paddle 激活环境 ``` ```
操作系统与硬件要求 支持系统:Windows 7/10、Ubuntu 18.04/20.04、CentOS 7、macOS(仅支持CPU版本)。 处理器架构:需为x86_64架构,暂不支持ARM架构。 Python版本:推荐Python 3.8/3.9/3.10/3.11/3.12,需确保p版本≥20.2.2。 GPU支持:若使用GPU版本,需提前安装NVIDIA显卡驱动(CUDA 11.0~12.0)及对应cuDNN库7。
操作系统与硬件要求
支持系统
支持系统:Windows 7/10、Ubuntu 18.04/20.04、CentOS 7、macOS(仅支持CPU版本)。 处理器架构:需为x86_64架构,暂不支持ARM架构。 Python版本:推荐Python 3.8/3.9/3.10/3.11/3.12,需确保p版本≥20.2.2。 GPU支持:若使用GPU版本,需提前安装NVIDIA显卡驱动(CUDA 11.0~12.0)及对应cuDNN库7。
支持系统:Windows 7/10、Ubuntu 18.04/20.04、CentOS 7、macOS(仅支持CPU版本)。
CUDA驱动版本,并通过官网查询PaddlePaddle支持的CUDA版本范围7。 重新安装匹配的GPU版本,例如: bash p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7 ``` ```
CUDA驱动版本,并通过官网查询PaddlePaddle支持的CUDA版本范围7。
镜像与宿主机CUDA版本是否一致。
源码编译(高级用户) 适用于定制化需求,需提前安装CMake、GCC等工具,具体步骤参考文档。
源码编译(高级用户)
确保已安装NVIDIA Container Toolkit(GPU版本)。 镜像与宿主机CUDA版本是否一致。
确保已安装NVIDIA Container Toolkit(GPU版本)。
示例: bash p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle ``` ```
超时或包下载失败 使用内镜像源(如清华源、源)加速下载。 示例: bash p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle ``` ``` CUDA版本不兼容 CUDA驱动版本,并通过官网查询PaddlePaddle支持的CUDA版本范围7。 重新安装匹配的GPU版本,例如: bash p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7 ``` ``` 哈希校验错误(Hash miatch) 通常因中断导致文件未完整下载,重新执行安装令即可10。 Docker容器启动失败 确保已安装NVIDIA Container Toolkit(GPU版本)。 镜像与宿主机CUDA版本是否一致。
超时或包下载失败 使用内镜像源(如清华源、源)加速下载。 示例: bash p install -i https://py.tuna.tsinghua.edu.cn/simple paddlepaddle ``` ```
超时或包下载失败
若输出“PaddlePaddle is installed successfully!”,且显示CUDA/cuDNN版本信息(GPU版本),则表明安装成功17。
虚拟环境配置(可选) 为依赖冲突,建议通过Anaconda创建独立环境: bash conda create -n paddle python=3.8 创建名为paddle的环境 conda activate paddle 激活环境 ``` ```
虚拟环境配置(可选) 为依赖冲突,建议通过Anaconda创建独立环境:
虚拟环境配置(可选)
辅助工具安装 安装PaddleX(模型训练工具包): bash p install paddlex ``` ``` 安装PaddleSlim(模型压缩工具): bash p install paddleslim ``` ```
辅助工具安装
通常因中断导致文件未完整下载,重新执行安装令即可10。
通过上述步骤,用户可根据自身软硬件条件选择合适的安装方式,快速搭建PaddlePaddle深度学习开发环境。
重新安装匹配的GPU版本,例如: bash p install paddlepaddle-gpu==2.4.2.post117 CUDA 11.7 ``` ```
集成开发环境(IDE)配置 在PyCharm或VS Code中,选择已安装PaddlePaddle的Python解释器路径。
集成开发环境(IDE)配置
相关问答
发表评论