Skip to content

Commit 287c04f

Browse files
authored
[Enhancement] refine the install doc (PaddlePaddle#2073)
1 parent fcccb67 commit 287c04f

File tree

7 files changed

+116
-56
lines changed

7 files changed

+116
-56
lines changed

benchmark/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ English | [简体中文](README_CN.md)
22

33
# Benchmark Introduction
44

5+
`PaddleSeg/benchmark` is used for monitoring the speed of model training.
6+
57
The content is as follow:
68

79
```

benchmark/README_CN.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# Benchmark说明
44

5+
`PaddleSeg/benchmark`用于监控模型训练的速度。
6+
7+
58
目录结构如下:
69
```
710
├── README.md

configs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
English | [简体中文](README_cn.md)
2+
3+
The config files of different models are saved in `PaddleSeg/configs`.
4+
PaddleSeg use the config files to train, validate and export models.
25
# Configuration items
36

47
----

configs/README_cn.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
大量模型的配置文件保存在`PaddleSeg/configs`目录下。 PaddleSeg使用这些配置文件进行模型训练、测试和导出。
12

23
# 配置项
34

docs/install.md

+35-29
Original file line numberDiff line numberDiff line change
@@ -13,62 +13,68 @@ English | [简体中文](install_cn.md)
1313

1414
### 1. Install PaddlePaddle
1515

16+
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).
17+
1618
Highly recommend you install the GPU version of PaddlePaddle, due to the large overhead of segmentation models, otherwise, it could be out of memory while running the models.
1719

18-
```
19-
# CUDA10.1
20-
python -m pip install paddlepaddle-gpu==2.2.1.post101 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
20+
For example, run the following command to install Paddle with pip for Linux, CUDA 10.1.
2121

22-
# CPU
23-
python -m pip install paddlepaddle==2.2.1 -i https://mirror.baidu.com/pypi/simple
2422
```
25-
- For quick installation of more CUDA versions or environments, please refer to [PaddlePaddle Quick Installation Document](https://www.paddlepaddle.org.cn/install/quick)
26-
- For more installation methods such as conda or source code compilation and installation methods, please refer to [PaddlePaddle Installation Document](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/index_en.html)
23+
python -m pip install paddlepaddle-gpu==2.2.2.post101 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
24+
```
25+
2726

28-
Please make sure that your PaddlePaddle is installed successfully and the version is not lower than the required version. Use the following command to verify.
27+
In Python interpreter, run the following command to confirm whether PaddlePaddle is installed successfully
2928

3029
```
31-
# Confirm that PaddlePaddle is installed successfully in your Python interpreter
3230
>>> import paddle
3331
>>> paddle.utils.run_check()
3432
35-
# Confirm PaddlePaddle version
36-
python -c "import paddle; print(paddle.__version__)"
37-
3833
# If the following prompt appears on the command line, the PaddlePaddle installation is successful.
3934
# PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
40-
```
41-
4235
36+
# Confirm PaddlePaddle version
37+
>>> print(paddle.__version__)
4338
44-
## 2. Install PaddleSeg
45-
Support API method for flexible development.
46-
```
47-
pip install paddleseg
4839
```
4940

50-
## 3. Download Repo
51-
Support Configuration Drive for simple and fast development.
41+
## 2. Download Repo
42+
43+
Clone the PaddleSeg repo from Github.
5244

5345
```
5446
git clone https://github.com/PaddlePaddle/PaddleSeg
5547
```
5648

5749
## 4. Install Dependencies
50+
5851
```
5952
cd PaddleSeg
6053
pip install -r requirements.txt
61-
62-
#If a version error occurs during installation, you can try to delete the old version and re-run the script.
6354
```
55+
56+
If a version error occurs during installation, you can try to delete the old version and re-run the script.
6457
## 5. Verify Installation
6558

66-
Run the following command to verify PaddleSeg installation. The predicted results will be in output/result if successful.
59+
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.
60+
61+
```
62+
cd PaddleSeg
63+
sh tests/run_check_install.sh
64+
```
65+
66+
## 3. Install PaddleSeg (Optional)
67+
68+
Besides, PaddleSeg also supports api method for flexible development, which requires the PaddleSeg is installed in python libs.
6769

68-
```python
69-
python predict.py \
70-
--config configs/quick_start/pp_liteseg_optic_disc_512x512_1k.yml \
71-
--model_path https://paddleseg.bj.bcebos.com/dygraph/optic_disc/pp_liteseg_optic_disc_512x512_1k/model.pdparams\
72-
--image_path docs/images/optic_test_image.jpg \
73-
--save_dir output/result
70+
Run the following command to compile and install PaddleSeg from source code.
71+
72+
```
73+
cd PaddleSeg
74+
python setup.py install
75+
```
76+
77+
Or, you can install the release PaddleSeg.
78+
```
79+
pip install paddleseg
7480
```

docs/install_cn.md

+49-27
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,77 @@
1414
## 安装说明
1515

1616
### 1. 安装PaddlePaddle
17-
```
18-
# CUDA10.1
19-
python -m pip install paddlepaddle-gpu==2.2.1.post101 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
2017

21-
# CPU
22-
python -m pip install paddlepaddle==2.2.1 -i https://mirror.baidu.com/pypi/simple
18+
请参考[快速安装文档](https://www.paddlepaddle.org.cn/install/quick)或者[详细安装文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/index_cn.html),安装PaddlePaddle (要求不低于2.2版本)。
19+
20+
比如Linux、CUDA 10.1,使用pip安装GPU版本,执行如下命令。
21+
22+
```
23+
python -m pip install paddlepaddle-gpu==2.2.2.post101 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
2324
```
24-
- 更多CUDA版本或环境快速安装,请参考[PaddlePaddle快速安装文档](https://www.paddlepaddle.org.cn/install/quick)
25-
- 更多安装方式例如conda或源码编译安装方法,请参考[PaddlePaddle安装文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/index_cn.html)
2625

27-
请确保您的PaddlePaddle安装成功并且版本不低于需求版本。使用以下命令进行验证
26+
使用如下命令验证PaddlePaddle是否安装成功,并且查看版本
2827

2928
```
30-
# 在您的Python解释器中确认PaddlePaddle安装成功
29+
# 在Python解释器中顺利执行如下命令
3130
>>> import paddle
3231
>>> paddle.utils.run_check()
3332
34-
# 确认PaddlePaddle版本
35-
python -c "import paddle; print(paddle.__version__)"
36-
3733
# 如果命令行出现以下提示,说明PaddlePaddle安装成功
3834
# PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
35+
36+
# 查看PaddlePaddle版本
37+
>>> print(paddle.__version__)
38+
3939
```
4040

41-
## 2. 安装PaddleSeg
42-
支持API方式灵活开发。
41+
## 2. 下载PaddleSeg代码
42+
43+
从Github下载PaddleSeg代码。
44+
4345
```
44-
pip install paddleseg
46+
git clone https://github.com/PaddlePaddle/PaddleSeg
4547
```
4648

47-
## 3. 下载PaddleSeg代码
49+
如果连不上Github,可以从Gitee下载PaddleSeg代码,但是Gitee上代码可能不是最新。
50+
4851
```
49-
git clone https://github.com/PaddlePaddle/PaddleSeg
52+
git clone https://gitee.com/paddlepaddle/PaddleSeg.git
5053
```
51-
## 4. 安装PaddleSeg依赖
54+
55+
## 3. 安装PaddleSeg依赖
56+
5257
```
5358
cd PaddleSeg
5459
pip install -r requirements.txt
60+
```
61+
62+
如果安装时出现版本错误,可以尝试删除旧版本,重新运行该脚本。
63+
64+
## 4.确认环境安装成功
65+
66+
在PaddleSeg目录下执行如下命令,会进行简单的单卡训练和单卡预测。
67+
68+
查看执行输出的log,没有报错,则验证安装成功。
69+
70+
然后,基于PaddleSeg,你可以使用配置文件的方式来训练、验证、测试和导出模型。
5571

56-
#如果安装时出现版本错误,可以尝试删除旧版本,重新运行该脚本。
5772
```
58-
## 5.确认环境安装成功
73+
sh tests/run_check_install.sh
74+
```
75+
76+
## 5. 安装PaddleSeg包(可选)
5977

60-
在PaddleSeg目录下,执行下面命令,如果PaddleSeg/output文件夹中出现预测结果,则证明安装成功
78+
PaddleSeg也支持API方式灵活开发。 API开发方式要求大家将PaddleSeg安装到Python库中
6179

62-
```python
63-
python predict.py \
64-
--config configs/quick_start/pp_liteseg_optic_disc_512x512_1k.yml \
65-
--model_path https://paddleseg.bj.bcebos.com/dygraph/optic_disc/pp_liteseg_optic_disc_512x512_1k/model.pdparams\
66-
--image_path docs/images/optic_test_image.jpg \
67-
--save_dir output/result
80+
81+
执行如下命令,从源码编译安装PaddleSeg包。
82+
```
83+
cd PaddleSeg
84+
python setup.py install
85+
```
86+
87+
或者直接安装发布的PaddleSeg包。
88+
```
89+
pip install paddleseg
6890
```

tests/run_check_install.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# download data
2+
mkdir data
3+
cd data
4+
wget https://paddleseg.bj.bcebos.com/dataset/optic_disc_seg.zip
5+
unzip optic_disc_seg.zip > /dev/null
6+
cd ..
7+
8+
# check traing
9+
python train.py \
10+
--config configs/quick_start/pp_liteseg_optic_disc_512x512_1k.yml \
11+
--iters 20 \
12+
--do_eval \
13+
--save_interval 20 \
14+
--save_dir output/pp_liteseg_optic_disc
15+
16+
echo -e "\n\n"
17+
18+
# check predicting
19+
python predict.py \
20+
--config configs/quick_start/pp_liteseg_optic_disc_512x512_1k.yml \
21+
--model_path https://paddleseg.bj.bcebos.com/dygraph/optic_disc/pp_liteseg_optic_disc_512x512_1k/model.pdparams\
22+
--image_path docs/images/optic_test_image.jpg \
23+
--save_dir output/result

0 commit comments

Comments
 (0)