提交 46962ebd 编写于 作者: G gaotingquan 提交者: cuicheng01

docs: merge docs about paddle & paddleclas installation

上级 307620f9
# Install PaddlePaddle # Preparation
--- ---
## Catalogue ## Catalogue
- [1. Prepara Environment](#1)
- [1.1 Install PaddlePaddle](#1.1)
- [1.1.1 By Docker](#1.1.1)
- [1.1.2 By pip](#1.1.2)
- [1.1.3 Check Installation](#1.1.3)
- [1.2 Get PaddleClas](#1.2)
- [1.3 Install Requirements](#1.3)
- [2. 快速创建PaddlePaddle, PaddleClas环境](#2)
- [1. Environment requirements](#1) - [1. Environment requirements](#1)
- [2.(Recommended) Prepare a docker environment](#2) - [2.(Recommended) Prepare a docker environment](#2)
- [3. Install PaddlePaddle using pip](#3) - [3. Install PaddlePaddle using pip](#3)
- [4. Verify installation](#4) - [4. Verify installation](#4)
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](https://docs.docker.com/get-started/). If you do not want to use docker, you can skip section [2. (Recommended) Prepare a docker environment](#2), and go into section [3. Install PaddlePaddle using pip](#3). Docker is recomended to run Paddleclas, for more detailed information about docker and nvidia-docker, you can refer to the [tutorial](https://docs.docker.com/get-started/). If you do not want to use docker, you can skip section [1.1.1 (Recommended) Install PaddlePaddle by docker](#1.1.1), and go into section [1.1.2 Install PaddlePaddle by pip](#1.1.2).
<a name="1"></a> <a name="1"></a>
## 1. Environment requirements ## 1. Prepara Environment
<a name="1.1"></a>
## 1.1 Install PaddlePaddle
- python 3.x - python 3.x
- cuda >= 10.1 (necessary if paddlepaddle-gpu is used) - cuda >= 10.2 (necessary if paddlepaddle-gpu is used)
- cudnn >= 7.6.4 (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) - nccl >= 2.1.2 (necessary distributed training/eval is used)
- gcc >= 8.2 - gcc >= 8.2
**Recomends**: **Recomends**:
* When CUDA version is 10.1, the driver version `>= 418.39`;
* When CUDA version is 10.2, the driver version `>= 440.33`; * When CUDA version is 10.2, the driver version `>= 440.33`;
* For more CUDA versions and specific driver versions, please refer to [link](https://docs.nvidia.com/deploy/cuda-compatibility/index.html). * For more CUDA versions and specific driver versions, please refer to [link](https://docs.nvidia.com/deploy/cuda-compatibility/index.html).
<a name="1.1.1"></a>
<a name="2"></a> ## 1.1.1 (Recommended) Install PaddlePaddle by Docker
## 2. (Recommended) Prepare a docker environment
* Switch to the working directory * Switch to the working directory
...@@ -41,10 +53,10 @@ The following commands will create a docker container named ppcls and map the cu ...@@ -41,10 +53,10 @@ The following commands will create a docker container named ppcls and map the cu
```shell ```shell
# For GPU users # 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 sudo nvidia-docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it registry.baidubce.com/paddlepaddle/paddle:2.4.2-gpu-cuda10.2-cudnn7.6-trt7.0 /bin/bash
# For CPU users # For CPU users
sudo docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it paddlepaddle/paddle:2.1.0 /bin/bash sudo docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it registry.baidubce.com/paddlepaddle/paddle:2.4.2 /bin/bash
``` ```
**Notices**: **Notices**:
...@@ -56,12 +68,12 @@ sudo docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it pa ...@@ -56,12 +68,12 @@ sudo docker run --name ppcls -v $PWD:/paddle --shm-size=8G --network=host -it pa
* After entering the docker container, you can exit the current container by pressing `Ctrl + P + Q` without closing the 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: * To re-enter the container, use the following command:
```shell ```shell
sudo Docker exec -it ppcls /bin/bash sudo docker exec -it ppcls /bin/bash
``` ```
<a name="3"></a> <a name="1.1.2"></a>
## 3. Install PaddlePaddle using pip ## 1.1.2 Install PaddlePaddle by pip
If you want to use PaddlePaddle on GPU, you can use the following command to install PaddlePaddle. If you want to use PaddlePaddle on GPU, you can use the following command to install PaddlePaddle.
...@@ -79,9 +91,9 @@ pip install paddlepaddle --upgrade -i https://mirror.baidu.com/pypi/simple ...@@ -79,9 +91,9 @@ pip install paddlepaddle --upgrade -i https://mirror.baidu.com/pypi/simple
* 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. * 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](http://www.paddlepaddle.org.cn/install/quick) to more compilation options. * You can also compile PaddlePaddle from source code, please refer to [PaddlePaddle Installation tutorial](http://www.paddlepaddle.org.cn/install/quick) to more compilation options.
<a name="4"></a> <a name="1.1.3"></a>
## 4. Verify Installation ## 1.1.3 Check Installation
```python ```python
import paddle import paddle
...@@ -98,3 +110,35 @@ Note: ...@@ -98,3 +110,35 @@ Note:
* Make sure the compiled source code is later than PaddlePaddle2.0. * Make sure the compiled source code is later than PaddlePaddle2.0.
* Indicate `WITH_DISTRIBUTE=ON` when compiling, Please refer to [Instruction](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#id3) for more details. * Indicate `WITH_DISTRIBUTE=ON` when compiling, Please refer to [Instruction](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#id3) 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. * 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.
<a name="1.2"></a>
## 1.2 Get PaddleClas
Clone PaddleClas source code
```shell
git clone https://github.com/PaddlePaddle/PaddleClas.git -b develop
```
If it is too slow for you to download from github, you can download PaddleClas from gitee. The command is as follows.
```shell
git clone https://gitee.com/paddlepaddle/PaddleClas.git -b develop
```
<a name="1.3"></a>
## 1.3 Install Requirements
* **[Recommended]** Installing from PyPI:
```shell
pip install paddleclas
```
* Please build and install locally if you need to use the develop branch of PaddleClas to experience the latest functions, or need to redevelop based on PaddleClas. The command is as follows:
```shell
python setup.py install
```
installation
================================
.. toctree::
:maxdepth: 2
install_paddle_en.md
install_paddleclas_en.md
# Install PaddleClas
---
## Catalogue
* [1. Clone PaddleClas source code](#1)
* [2. Install requirements](#2)
<a name='1'></a>
### 1. Clone PaddleClas source code
```shell
git clone https://github.com/PaddlePaddle/PaddleClas.git -b develop
```
If it is too slow for you to download from github, you can download PaddleClas from gitee. The command is as follows.
```shell
git clone https://gitee.com/paddlepaddle/PaddleClas.git -b develop
```
<a name='2'></a>
## 2. Install PaddleClas and requirements
* **[Recommended]** Installing from PyPI:
```shell
pip install paddleclas
```
* Please build and install locally if you need to use the develop branch of PaddleClas to experience the latest functions, or need to redevelop based on PaddleClas. The command is as follows:
```shell
python setup.py install
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册