51 Star 365 Fork 119

PaddlePaddle / PaddleClas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install_paddle_en.md 4.06 KB
一键复制 编辑 原始数据 按行查看 历史
sibo2rr 提交于 2022-02-14 20:31 . fix: remove outdated files

Install PaddlePaddle


Catalogue

At present, PaddleClas requires PaddlePaddle version >=2.0. Docker is recomended to run Paddleclas, for more detailed information about docker and nvidia-docker, you can refer to the tutorial. If you do not want to use docker, you can skip section 2. (Recommended) Prepare a docker environment, and go into section 3. Install PaddlePaddle using pip.

1. Environment requirements

  • python 3.x
  • cuda >= 10.1 (necessary if paddlepaddle-gpu is used)
  • cudnn >= 7.6.4 (necessary if paddlepaddle-gpu is used)
  • nccl >= 2.1.2 (necessary distributed training/eval is used)
  • gcc >= 8.2

Recomends:

  • When CUDA version is 10.1, the driver version >= 418.39;
  • When CUDA version is 10.2, the driver version >= 440.33;
  • For more CUDA versions and specific driver versions, please refer to link.

2. (Recommended) Prepare a docker environment

  • Switch to the working directory
cd /home/Projects
  • Create docker container The following commands will create a docker container named ppcls and map the current working directory to the `/paddle' directory in the container.
# For GPU users
sudo nvidia-docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it paddlepaddle/paddle:2.1.0-gpu-cuda10.2-cudnn7 /bin/bash

# For CPU users
sudo docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it paddlepaddle/paddle:2.1.0 /bin/bash

Notices:

  • The first time you use this docker image, it will be downloaded automatically. Please be patient;
  • The above command will create a docker container named ppcls, and there is no need to run the command again when using the container again;
  • The parameter --shm-size=8g will set the shared memory of the container to 8g. If conditions permit, it is recommended to set this parameter to a larger value, such as 64g;
  • You can also access DockerHub to obtain the image adapted to your machine;
  • Exit / Enter the docker container:
    • After entering the docker container, you can exit the current container by pressing Ctrl + P + Q without closing the container;
    • To re-enter the container, use the following command:
    sudo Docker exec -it ppcls /bin/bash

3. Install PaddlePaddle using pip

If you want to use PaddlePaddle on GPU, you can use the following command to install PaddlePaddle.

pip install paddlepaddle-gpu --upgrade -i https://mirror.baidu.com/pypi/simple

If you want to use PaddlePaddle on CPU, you can use the following command to install PaddlePaddle.

pip install paddlepaddle --upgrade -i https://mirror.baidu.com/pypi/simple

Note:

  • If you have already installed CPU version of PaddlePaddle and want to use GPU version now, you should uninstall CPU version of PaddlePaddle and then install GPU version to avoid package confusion.
  • You can also compile PaddlePaddle from source code, please refer to PaddlePaddle Installation tutorial to more compilation options.

4. Verify Installation

import paddle
paddle.utils.run_check()

Check PaddlePaddle version:

python -c "import paddle; print(paddle.__version__)"

Note:

  • Make sure the compiled source code is later than PaddlePaddle2.0.
  • Indicate WITH_DISTRIBUTE=ON when compiling, Please refer to Instruction for more details.
  • When running in docker, in order to ensure that the container has enough shared memory for dataloader acceleration of Paddle, please set the parameter --shm-size=8g at creating a docker container, if conditions permit, you can set it to a larger value.
Python
1
https://gitee.com/paddlepaddle/PaddleClas.git
git@gitee.com:paddlepaddle/PaddleClas.git
paddlepaddle
PaddleClas
PaddleClas
release/2.5

搜索帮助