Merge pull request #4638 from LDOUBLEV/test_v11

rename params.txt for win, jeston and mac  and fix doc
pull/4664/head^2
MissPenguin 2021-11-15 14:13:45 +08:00 committed by GitHub
commit 6301f9bf9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 31 deletions

View File

@ -47,11 +47,11 @@ Jeston端基础训练预测功能测试的主程序为`test_train_inference_pyth
```
- 模式3whole_infer不训练全量数据预测走通开源模型评估、动转静检查inference model预测时间和精度;
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_jetson.txt 'whole_infer'
# 用法1:
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/jeston_ppocr_det_mobile_params.txt 'whole_infer'
bash test_tipc/test_inference_jeston.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_jetson.txt 'whole_infer'
# 用法2: 指定GPU卡预测第三个传入参数为GPU卡号
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/jeston_ppocr_det_mobile_params.txt 'whole_infer' '1'
bash test_tipc/test_inference_jeston.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_jetson.txt 'whole_infer' '1'
```
运行相应指令后,在`test_tipc/output`文件夹下自动会保存运行日志。如`lite_train_lite_infer`模式下,会运行训练+inference的链条因此在`test_tipc/output`文件夹有以下文件:

View File

@ -57,35 +57,36 @@ Mac端无GPU环境准备只需要Python环境即可安装PaddlePaddle等
```shell
# 同linux端运行不同的是Mac端测试使用新的配置文件mac_ppocr_det_mobile_params.txt
# 配置文件中默认去掉了GPU和mkldnn相关的测试链条
bash test_tipc/prepare.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'lite_train_lite_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'lite_train_lite_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'lite_train_lite_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'lite_train_lite_infer'
```
- 模式2lite_train_whole_infer使用少量数据训练一定量数据预测用于验证训练后的模型执行预测预测速度是否合理
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'lite_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'lite_train_whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'lite_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'lite_train_whole_infer'
```
- 模式3whole_infer不训练全量数据预测走通开源模型评估、动转静检查inference model预测时间和精度;
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'whole_infer'
# 用法1:
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'whole_infer'
# 用法2: 指定GPU卡预测第三个传入参数为GPU卡号
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'whole_infer' '1'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'whole_infer' '1'
```
- 模式4whole_train_whole_inferCE 全量数据训练全量数据预测验证模型训练精度预测精度预测速度Mac端不建议运行此模式
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'whole_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'whole_train_whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'whole_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'whole_train_whole_infer'
```
- 模式5klquant_whole_infer测试离线量化
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/mac_ppocr_det_mobile_params.txt 'klquant_whole_infer'
bash test_tipc/test_train_inference_python.sh test_tipc/configs/mac_ppocr_det_mobile_params.txt 'klquant_whole_infer'
bash test_tipc/prepare.sh ./test_tipc/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'klquant_whole_infer'
bash test_tipc/test_train_inference_python.sh test_tipc/configs/ppocr_det_mobile/train_mac_cpu_normal_normal_infer_python_mac_cpu.txt 'klquant_whole_infer'
```
运行相应指令后,在`test_tipc/output`文件夹下自动会保存运行日志。如`lite_train_lite_infer`模式下,会运行训练+inference的链条因此在`test_tipc/output`文件夹有以下文件:
@ -134,11 +135,19 @@ python test_tipc/compare_results.py --gt_file=./test_tipc/results/python_*.txt
#### 运行结果
正常运行效果如下图:
<img src="compare_right.png" width="1000">
正常运行效果如下:
```
Assert allclose passed! The results of python_infer_cpu_usemkldnn_False_threads_1_batchsize_1.log and ./test_tipc/results/python_ppocr_det_mobile_results_fp32.txt are consistent!
```
出现不一致结果时的运行输出:
<img src="compare_wrong.png" width="1000">
```
......
Traceback (most recent call last):
File "test_tipc/compare_results.py", line 140, in <module>
format(filename, gt_filename))
ValueError: The results of python_infer_cpu_usemkldnn_False_threads_1_batchsize_1.log and the results of ./test_tipc/results/python_ppocr_det_mobile_results_fp32.txt are inconsistent!
```
## 3. 更多教程

View File

@ -58,35 +58,35 @@ Windows端基础训练预测功能测试的主程序为`test_train_inference_pyt
- 模式1lite_train_lite_infer使用少量数据训练用于快速验证训练到预测的走通流程不验证精度和速度
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'lite_train_lite_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'lite_train_lite_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'lite_train_lite_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'lite_train_lite_infer'
```
- 模式2lite_train_whole_infer使用少量数据训练一定量数据预测用于验证训练后的模型执行预测预测速度是否合理
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'lite_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'lite_train_whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'lite_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'lite_train_whole_infer'
```
- 模式3whole_infer不训练全量数据预测走通开源模型评估、动转静检查inference model预测时间和精度;
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'whole_infer'
# 用法1:
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'whole_infer'
# 用法2: 指定GPU卡预测第三个传入参数为GPU卡号
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'whole_infer' '1'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'whole_infer' '1'
```
- 模式4whole_train_whole_inferCE 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'whole_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'whole_train_whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'whole_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'whole_train_whole_infer'
```
- 模式5klquant_whole_infer测试离线量化
```shell
bash test_tipc/prepare.sh ./test_tipc/configs/win_ppocr_det_mobile_params.txt 'klquant_whole_infer'
bash test_tipc/test_train_inference_python.sh test_tipc/configs/win_ppocr_det_mobile_params.txt 'klquant_whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'klquant_whole_infer'
bash test_tipc/test_train_inference_python.sh test_tipc/configs/ppocr_det_mobile/train_windows_gpu_normal_normal_infer_python_windows_cpu_gpu.txt 'klquant_whole_infer'
```
@ -138,11 +138,19 @@ python test_tipc/compare_results.py --gt_file=./test_tipc/results/python_*.txt
#### 运行结果
正常运行效果如下图:
<img src="compare_right.png" width="1000">
正常运行效果如下:
```
Assert allclose passed! The results of python_infer_cpu_usemkldnn_False_threads_1_batchsize_1.log and ./test_tipc/results/python_ppocr_det_mobile_results_fp32.txt are consistent!
```
出现不一致结果时的运行输出:
<img src="compare_wrong.png" width="1000">
```
......
Traceback (most recent call last):
File "test_tipc/compare_results.py", line 140, in <module>
format(filename, gt_filename))
ValueError: The results of python_infer_cpu_usemkldnn_False_threads_1_batchsize_1.log and the results of ./test_tipc/results/python_ppocr_det_mobile_results_fp32.txt are inconsistent!
```
## 3. 更多教程