Skip to content

Commit

Permalink
[Doc] Refine the doc of installation (#2546)
Browse files Browse the repository at this point in the history
* [Doc] Refine the doc of installation
* add PULL_REQUEST_TEMPLATE.md
  • Loading branch information
juncaipeng committed Sep 16, 2022
1 parent 12da8c5 commit e5c2a47
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 74 deletions.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### PR types
<!-- One of [ New features | Bug fixes | Function optimization | Performance optimization | Breaking changes | Others ] -->

### PR changes
<!-- One of [ Models | APIs | Docs | Others ] -->

### Description
<!-- Describe what this PR does -->
43 changes: 20 additions & 23 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
English | [简体中文](install_cn.md)


## Environment Requirements
## 1 Environment Requirements

- PaddlePaddle (the version >= 2.2)
- OS: 64-bit
Expand All @@ -10,9 +10,9 @@ English | [简体中文](install_cn.md)
- CUDA >= 10.1
- cuDNN >= 7.6

## Installation
## 2 Installation

### 1. Install PaddlePaddle
### 2.1 Install PaddlePaddle

Please refer to the [installation doc](https://www.paddlepaddle.org.cn/documentation/docs/en/install/index_en.html) to install PaddlePaddle (the version >= 2.2).

Expand All @@ -39,48 +39,45 @@ In Python interpreter, run the following command to confirm whether PaddlePaddle
```

### 2. Download Repo
### 2.2 Install PaddleSeg

If you make modification to `PaddleSeg/paddleseg`, e.g, adding model and loss, you should install PaddleSeg from source.

If you only use PaddleSeg library, please install complied PaddleSeg.

#### 2.2.1 Install PaddleSeg from Source

Clone the PaddleSeg repo from Github.

```
git clone https://github.com/PaddlePaddle/PaddleSeg
```

### 3. Install Dependencies
Run the following command, install PaddleSeg from source. If you make modification to `PaddleSeg/paddleseg`, it will be efficient without reinstallation.

```
cd PaddleSeg
pip install -r requirements.txt
pip install -v -e .
```
#### 2.2.2 Install Compiled PaddleSeg

If a version error occurs during installation, you can try to delete the old version and re-run the script.
### 4. Verify Installation

In the root of PaddleSeg, run the following command. If there are no error in terminal log, you can use PaddleSeg to train, validate, test and export models with config method.
Run the following command, install the complied PaddleSeg.

```
cd PaddleSeg
sh tests/run_check_install.sh
pip install paddleseg
```

### 5. Install PaddleSeg (Optional)
### 2.3 Verify Installation

Besides, PaddleSeg also supports api method for flexible development, which requires the PaddleSeg is installed in python libs.

Run the following command to compile and install PaddleSeg from source code.
In the root of PaddleSeg, run the following command.
If there are no error in terminal log, you can use PaddleSeg to train, validate, test and export models with config method.

```
cd PaddleSeg
python setup.py install
```

Or, you can install the release PaddleSeg.
```
pip install paddleseg
sh tests/install/check_predict.sh
```

## Use PaddleSeg with Docker
## 3 Use PaddleSeg with Docker

Docker is an open-source tool to build, ship, and run distributed applications in an isolated environment. If you do not have a Docker environment, please refer to [Docker](https://www.docker.com/). If you will use GPU version, you also need to install [nvidia-docker](https://github.com/NVIDIA/nvidia-docker).

Expand Down
45 changes: 17 additions & 28 deletions docs/install_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 安装文档


## 环境要求
## 1 环境要求

- PaddlePaddle (版本不低于2.2)
- OS 64位操作系统
Expand All @@ -11,9 +11,9 @@
- CUDA >= 10.1
- cuDNN >= 7.6

## 一、本地安装说明
## 2 本地安装说明

### 1. 安装PaddlePaddle
### 2.1 安装PaddlePaddle

请参考[快速安装文档](https://www.paddlepaddle.org.cn/install/quick)或者[详细安装文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/index_cn.html),安装PaddlePaddle (要求不低于2.2版本,推荐安装最新版本)。

Expand All @@ -38,7 +38,11 @@ python -m pip install paddlepaddle-gpu==2.2.2.post101 -f https://www.paddlepaddl
```

### 2. 下载PaddleSeg代码
### 2.2 安装PaddleSeg

如果大家需要基于PaddleSeg进行开发和调试,推荐采用源码安装的方式。如果大家只是调用PaddleSeg,推荐安装发布的PaddleSeg包。

#### 2.2.1 源码安装PaddleSeg

从Github下载PaddleSeg代码。

Expand All @@ -52,45 +56,30 @@ git clone https://github.com/PaddlePaddle/PaddleSeg
git clone https://gitee.com/paddlepaddle/PaddleSeg.git
```

### 3. 安装PaddleSeg依赖
执行如下命令,从源码编译安装PaddleSeg包。大家对于`PaddleSeg/paddleseg`目录下的修改,都会立即生效,无需重新安装。

```
cd PaddleSeg
pip install -r requirements.txt
pip install -v -e .
```

如果安装时出现版本错误,可以尝试删除旧版本,重新运行该脚本。
#### 2.2.2 安装发布的PaddleSeg

### 4.确认环境安装成功

在PaddleSeg目录下执行如下命令,会进行简单的单卡训练和单卡预测。
执行如下命令,安装发布的PaddleSeg包。

```
sh tests/run_check_install.sh
pip install paddleseg
```

查看执行输出的log,没有报错,则验证安装成功。

然后,基于PaddleSeg,你可以使用配置文件的方式来训练、验证、测试和导出模型。


### 5. 安装PaddleSeg包(可选)
### 2.3 确认环境安装成功

PaddleSeg也支持API方式灵活开发。 API开发方式要求大家将PaddleSeg安装到Python库中
在PaddleSeg目录下执行如下命令,会进行简单的单卡预测。查看执行输出的log,没有报错,则验证安装成功


执行如下命令,从源码编译安装PaddleSeg包。
```
cd PaddleSeg
python setup.py install
```

或者直接安装发布的PaddleSeg包。
```
pip install paddleseg
sh tests/install/check_predict.sh
```

## 二、使用Docker快速体验PaddleSeg
## 3 使用Docker快速体验PaddleSeg

Docker是一种开源工具,用于在和系统本身环境相隔离的环境中构建、发布和运行各类应用程序。如果您没有Docker运行环境,请参考[Docker 官网](https://www.docker.com/)进行安装,如果您准备使用GPU版本镜像,还需要提前安装好[nvidia-docker](https://github.com/NVIDIA/nvidia-docker)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions tests/install/check_predict.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# check predicting
python predict.py \
--config configs/quick_start/pp_liteseg_optic_disc_512x512_1k.yml \
--model_path https://paddleseg.bj.bcebos.com/dygraph/optic_disc/pp_liteseg_optic_disc_512x512_1k/model.pdparams \
--image_path docs/images/optic_test_image.jpg \
--save_dir output/result
23 changes: 0 additions & 23 deletions tests/run_check_install.sh

This file was deleted.

0 comments on commit e5c2a47

Please sign in to comment.