未验证 提交 8b8d3e2c 编写于 作者: H HydrogenSulfate 提交者: GitHub

Merge pull request #2129 from HydrogenSulfate/fix_2022_7_4

Fix TIPC bugs
...@@ -38,16 +38,16 @@ infer_model:../inference/ ...@@ -38,16 +38,16 @@ infer_model:../inference/
infer_export:True infer_export:True
infer_quant:Fasle infer_quant:Fasle
inference:python/predict_rec.py -c configs/inference_rec.yaml inference:python/predict_rec.py -c configs/inference_rec.yaml
-o Global.use_gpu:False -o Global.use_gpu:True|False
-o Global.enable_mkldnn:True|False -o Global.enable_mkldnn:False
-o Global.cpu_num_threads:1|6 -o Global.cpu_num_threads:1
-o Global.batch_size:1|16 -o Global.batch_size:1
-o Global.use_tensorrt:True|False -o Global.use_tensorrt:False
-o Global.use_fp16:True|False -o Global.use_fp16:False
-o Global.rec_inference_model_dir:../inference -o Global.rec_inference_model_dir:../inference
-o Global.infer_imgs:../dataset/Aliproduct/demo_test/ -o Global.infer_imgs:../dataset/Aliproduct/demo_test/
-o Global.save_log_path:null -o Global.save_log_path:null
-o Global.benchmark:True -o Global.benchmark:False
null:null null:null
null:null null:null
===========================infer_benchmark_params========================== ===========================infer_benchmark_params==========================
......
===========================paddle2onnx_params=========================== ===========================paddle2onnx_params===========================
model_name:PP-ShiTu_general_rec model_name:GeneralRecognition_PPLCNet_x2_5
python:python3.7 python:python3.7
2onnx: paddle2onnx 2onnx: paddle2onnx
--model_dir:./deploy/models/general_PPLCNet_x2_5_lite_v1.0_infer/ --model_dir:./deploy/models/general_PPLCNet_x2_5_lite_v1.0_infer/
...@@ -9,8 +9,8 @@ python:python3.7 ...@@ -9,8 +9,8 @@ python:python3.7
--opset_version:10 --opset_version:10
--enable_onnx_checker:True --enable_onnx_checker:True
inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/general_PPLCNet_x2_5_lite_v1.0_infer.tar inference_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/general_PPLCNet_x2_5_lite_v1.0_infer.tar
inference:./python/predict_cls.py inference:./python/predict_rec.py
Global.use_onnx:True Global.use_onnx:True
Global.inference_model_dir:./models/general_PPLCNet_x2_5_lite_v1.0_infer Global.rec_inference_model_dir:./models/general_PPLCNet_x2_5_lite_v1.0_infer
Global.use_gpu:False Global.use_gpu:False
-c:configs/inference_cls.yaml -c:configs/inference_rec.yaml
\ No newline at end of file \ No newline at end of file
...@@ -38,16 +38,16 @@ infer_model:../inference/ ...@@ -38,16 +38,16 @@ infer_model:../inference/
infer_export:True infer_export:True
infer_quant:Fasle infer_quant:Fasle
inference:python/predict_cls.py -c configs/inference_cls.yaml -o PreProcess.transform_ops.0.ResizeImage.resize_short=236 inference:python/predict_cls.py -c configs/inference_cls.yaml -o PreProcess.transform_ops.0.ResizeImage.resize_short=236
-o Global.use_gpu:False -o Global.use_gpu:True|False
-o Global.enable_mkldnn:True|False -o Global.enable_mkldnn:False
-o Global.cpu_num_threads:1|6 -o Global.cpu_num_threads:1
-o Global.batch_size:1|16 -o Global.batch_size:1
-o Global.use_tensorrt:True|False -o Global.use_tensorrt:False
-o Global.use_fp16:True|False -o Global.use_fp16:False
-o Global.inference_model_dir:../inference -o Global.inference_model_dir:../inference
-o Global.infer_imgs:../dataset/ILSVRC2012/val -o Global.infer_imgs:../dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG
-o Global.save_log_path:null -o Global.save_log_path:null
-o Global.benchmark:True -o Global.benchmark:False
null:null null:null
===========================infer_benchmark_params========================== ===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}] random_infer_input:[{float32,[3,224,224]}]
...@@ -38,16 +38,16 @@ infer_model:../inference/ ...@@ -38,16 +38,16 @@ infer_model:../inference/
infer_export:True infer_export:True
infer_quant:Fasle infer_quant:Fasle
inference:python/predict_cls.py -c configs/inference_cls.yaml inference:python/predict_cls.py -c configs/inference_cls.yaml
-o Global.use_gpu:False -o Global.use_gpu:True|False
-o Global.enable_mkldnn:True|False -o Global.enable_mkldnn:False
-o Global.cpu_num_threads:1|6 -o Global.cpu_num_threads:1
-o Global.batch_size:1|16 -o Global.batch_size:1
-o Global.use_tensorrt:True|False -o Global.use_tensorrt:False
-o Global.use_fp16:True|False -o Global.use_fp16:False
-o Global.inference_model_dir:../inference -o Global.inference_model_dir:../inference
-o Global.infer_imgs:../dataset/ILSVRC2012/val -o Global.infer_imgs:../dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG
-o Global.save_log_path:null -o Global.save_log_path:null
-o Global.benchmark:True -o Global.benchmark:False
null:null null:null
===========================infer_benchmark_params========================== ===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}] random_infer_input:[{float32,[3,224,224]}]
\ No newline at end of file
...@@ -38,16 +38,16 @@ infer_model:../inference/ ...@@ -38,16 +38,16 @@ infer_model:../inference/
infer_export:True infer_export:True
infer_quant:Fasle infer_quant:Fasle
inference:python/predict_cls.py -c configs/inference_cls.yaml inference:python/predict_cls.py -c configs/inference_cls.yaml
-o Global.use_gpu:False -o Global.use_gpu:True|False
-o Global.enable_mkldnn:True|False -o Global.enable_mkldnn:False
-o Global.cpu_num_threads:1|6 -o Global.cpu_num_threads:1
-o Global.batch_size:1|16 -o Global.batch_size:1
-o Global.use_tensorrt:True|False -o Global.use_tensorrt:False
-o Global.use_fp16:True|False -o Global.use_fp16:False
-o Global.inference_model_dir:../inference -o Global.inference_model_dir:../inference
-o Global.infer_imgs:../dataset/ILSVRC2012/val -o Global.infer_imgs:../dataset/ILSVRC2012/val/ILSVRC2012_val_00000001.JPEG
-o Global.save_log_path:null -o Global.save_log_path:null
-o Global.benchmark:True -o Global.benchmark:False
null:null null:null
===========================infer_benchmark_params========================== ===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}] random_infer_input:[{float32,[3,224,224]}]
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
```shell ```shell
# 运行格式:bash test_tipc/prepare.sh train_benchmark.txt mode # 运行格式:bash test_tipc/prepare.sh train_benchmark.txt mode
bash test_tipc/prepare.sh test_tipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt benchmark_train bash test_tipc/prepare.sh test_tipc/configs/MobileNetV2/MobileNetV2_train_infer_python.txt benchmark_train
``` ```
## 1.2 功能测试 ## 1.2 功能测试
...@@ -17,14 +17,14 @@ bash test_tipc/prepare.sh test_tipc/config/MobileNetV2/MobileNetV2_train_infer_p ...@@ -17,14 +17,14 @@ bash test_tipc/prepare.sh test_tipc/config/MobileNetV2/MobileNetV2_train_infer_p
```shell ```shell
# 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode # 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode
bash test_tipc/benchmark_train.sh test_tipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt benchmark_train bash test_tipc/benchmark_train.sh test_tipc/configs/MobileNetV2/MobileNetV2_train_infer_python.txt benchmark_train
``` ```
`test_tipc/benchmark_train.sh`支持根据传入的第三个参数实现只运行某一个训练配置,如下: `test_tipc/benchmark_train.sh`支持根据传入的第三个参数实现只运行某一个训练配置,如下:
```shell ```shell
# 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode params # 运行格式:bash test_tipc/benchmark_train.sh train_benchmark.txt mode params
bash test_tipc/benchmark_train.sh test_tipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt benchmark_train dynamic_bs8_fp32_DP_N1C1 bash test_tipc/benchmark_train.sh test_tipc/configs/MobileNetV2/MobileNetV2_train_infer_python.txt benchmark_train dynamic_bs8_fp32_DP_N1C1
``` ```
dynamic_bs8_fp32_DP_N1C1为test_tipc/benchmark_train.sh传入的参数,格式如下: dynamic_bs8_fp32_DP_N1C1为test_tipc/benchmark_train.sh传入的参数,格式如下:
`${modeltype}_${batch_size}_${fp_item}_${run_mode}_${device_num}` `${modeltype}_${batch_size}_${fp_item}_${run_mode}_${device_num}`
...@@ -33,7 +33,7 @@ dynamic_bs8_fp32_DP_N1C1为test_tipc/benchmark_train.sh传入的参数,格式 ...@@ -33,7 +33,7 @@ dynamic_bs8_fp32_DP_N1C1为test_tipc/benchmark_train.sh传入的参数,格式
## 2. 日志输出 ## 2. 日志输出
运行后将保存模型的训练日志和解析日志,使用 `test_tipc/config/MobileNetV2/MobileNetV2_train_infer_python.txt` 参数文件的训练日志解析结果是: 运行后将保存模型的训练日志和解析日志,使用 `test_tipc/configs/MobileNetV2/MobileNetV2_train_infer_python.txt` 参数文件的训练日志解析结果是:
``` ```
{"model_branch": "dygaph", "model_commit": "7c39a1996b19087737c05d883fd346d2f39dbcc0", "model_name": "cls_MobileNetV2_bs8_fp32_SingleP_DP", "batch_size": 8, "fp_item": "fp32", "run_process_type": "SingleP", "run_mode": "DP", "convergence_value": "5.413110", "convergence_key": "loss:", "ips": 19.333, "speed_unit": "samples/s", "device_num": "N1C1", "model_run_time": "0", "frame_commit": "8cc09552473b842c651ead3b9848d41827a3dbab", "frame_version": "0.0.0"} {"model_branch": "dygaph", "model_commit": "7c39a1996b19087737c05d883fd346d2f39dbcc0", "model_name": "cls_MobileNetV2_bs8_fp32_SingleP_DP", "batch_size": 8, "fp_item": "fp32", "run_process_type": "SingleP", "run_mode": "DP", "convergence_value": "5.413110", "convergence_key": "loss:", "ips": 19.333, "speed_unit": "samples/s", "device_num": "N1C1", "model_run_time": "0", "frame_commit": "8cc09552473b842c651ead3b9848d41827a3dbab", "frame_version": "0.0.0"}
......
...@@ -246,7 +246,7 @@ make -j ...@@ -246,7 +246,7 @@ make -j
* 可执行以下命令,自动完成上述准备环境中的所需内容 * 可执行以下命令,自动完成上述准备环境中的所需内容
```shell ```shell
bash test_tipc/prepare.sh test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt cpp_infer bash test_tipc/prepare.sh test_tipc/configs/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt cpp_infer
``` ```
### 2.3 功能测试 ### 2.3 功能测试
...@@ -260,7 +260,7 @@ bash test_tipc/test_inference_cpp.sh ${your_params_file} cpp_infer ...@@ -260,7 +260,7 @@ bash test_tipc/test_inference_cpp.sh ${your_params_file} cpp_infer
`ResNet50``Linux GPU/CPU C++推理测试`为例,命令如下所示。 `ResNet50``Linux GPU/CPU C++推理测试`为例,命令如下所示。
```shell ```shell
bash test_tipc/test_inference_cpp.sh test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt cpp_infer bash test_tipc/test_inference_cpp.sh test_tipc/configs/ResNet/ResNet50_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt cpp_infer
``` ```
输出结果如下,表示命令运行成功。 输出结果如下,表示命令运行成功。
......
...@@ -15,7 +15,7 @@ Lite_arm_cpp_cpu 预测功能测试的主程序为`test_lite_arm_cpu_cpp.sh`, ...@@ -15,7 +15,7 @@ Lite_arm_cpp_cpu 预测功能测试的主程序为`test_lite_arm_cpu_cpp.sh`,
先运行 `prepare_lite_arm_cpu_cpp.sh` 准备数据和模型,然后运行 `test_lite_arm_cpu_cpp.sh` 进行测试,最终在 `./output` 目录下生成 `lite_*.log` 后缀的日志文件。 先运行 `prepare_lite_arm_cpu_cpp.sh` 准备数据和模型,然后运行 `test_lite_arm_cpu_cpp.sh` 进行测试,最终在 `./output` 目录下生成 `lite_*.log` 后缀的日志文件。
```shell ```shell
bash test_tipc/prepare_lite_arm_cpu_cpp.sh test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_lite_arm_cpu_cpp.txt bash test_tipc/prepare_lite_arm_cpu_cpp.sh test_tipc/configs/MobileNetV3/MobileNetV3_large_x1_0_lite_arm_cpu_cpp.txt
``` ```
运行预测指令后,在`./output`文件夹下自动会保存运行日志,包括以下文件: 运行预测指令后,在`./output`文件夹下自动会保存运行日志,包括以下文件:
......
...@@ -21,10 +21,10 @@ PaddleServing预测功能测试的主程序为`test_paddle2onnx.sh`,可以测 ...@@ -21,10 +21,10 @@ PaddleServing预测功能测试的主程序为`test_paddle2onnx.sh`,可以测
下方展示以PPHGNet_small为例的测试命令与结果。 下方展示以PPHGNet_small为例的测试命令与结果。
```shell ```shell
bash test_tipc/prepare.sh ./test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt paddle2onnx_infer bash test_tipc/prepare.sh ./test_tipc/configs/ResNet/ResNet50_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt paddle2onnx_infer
# 用法: # 用法:
bash test_tipc/test_paddle2onnx.sh ./test_tipc/config/ResNet/ResNet50_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt bash test_tipc/test_paddle2onnx.sh ./test_tipc/configs/ResNet/ResNet50_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt
``` ```
#### 运行结果 #### 运行结果
......
...@@ -34,7 +34,7 @@ Linux GPU/CPU 多机多卡训练推理测试的主程序为`test_train_inference ...@@ -34,7 +34,7 @@ Linux GPU/CPU 多机多卡训练推理测试的主程序为`test_train_inference
#### 2.1.1 修改配置文件 #### 2.1.1 修改配置文件
首先,修改配置文件`test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt`中的`gpu_list`设置:假设两台机器的`ip`地址分别为`192.168.0.1``192.168.0.2`,则对应的配置文件`gpu_list`字段需要修改为`gpu_list:192.168.0.1,192.168.0.2;0,1` 首先,修改配置文件`test_tipc/configs/PPLCNet/PPLCNet_x1_0_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt`中的`gpu_list`设置:假设两台机器的`ip`地址分别为`192.168.0.1``192.168.0.2`,则对应的配置文件`gpu_list`字段需要修改为`gpu_list:192.168.0.1,192.168.0.2;0,1`
**`ip`地址查看命令为`ifconfig`,在`inet addr:`字段后的即为ip地址** **`ip`地址查看命令为`ifconfig`,在`inet addr:`字段后的即为ip地址**
...@@ -44,7 +44,7 @@ Linux GPU/CPU 多机多卡训练推理测试的主程序为`test_train_inference ...@@ -44,7 +44,7 @@ Linux GPU/CPU 多机多卡训练推理测试的主程序为`test_train_inference
运行`prepare.sh`准备数据和模型,数据准备命令如下所示。 运行`prepare.sh`准备数据和模型,数据准备命令如下所示。
```shell ```shell
bash test_tipc/prepare.sh test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt lite_train_lite_infer bash test_tipc/prepare.sh test_tipc/configs/PPLCNet/PPLCNet_x1_0_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt lite_train_lite_infer
``` ```
**注意:** 由于是多机训练,这里需要在所有节点上都运行一次启动上述命令来准备数据。 **注意:** 由于是多机训练,这里需要在所有节点上都运行一次启动上述命令来准备数据。
...@@ -60,7 +60,7 @@ export FLAGS_START_PORT=17000 ...@@ -60,7 +60,7 @@ export FLAGS_START_PORT=17000
接下来就可以开始执行测试,命令如下所示。 接下来就可以开始执行测试,命令如下所示。
```shell ```shell
bash test_tipc/test_train_inference_python.sh test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt bash test_tipc/test_train_inference_python.sh test_tipc/configs/PPLCNet/PPLCNet_x1_0_train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
``` ```
**注意:** 由于是多机训练,这里需要在所有的节点上均运行启动上述命令进行测试。 **注意:** 由于是多机训练,这里需要在所有的节点上均运行启动上述命令进行测试。
......
...@@ -58,36 +58,36 @@ Linux端基础训练预测功能测试的主程序为`test_train_inference_pytho ...@@ -58,36 +58,36 @@ Linux端基础训练预测功能测试的主程序为`test_train_inference_pytho
- 模式1:lite_train_lite_infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度; - 模式1:lite_train_lite_infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度;
```shell ```shell
bash test_tipc/prepare.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_lite_infer' bash test_tipc/prepare.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_lite_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_lite_infer' bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_lite_infer'
``` ```
- 模式2:lite_train_whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理; - 模式2:lite_train_whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理;
```shell ```shell
bash test_tipc/prepare.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_whole_infer' bash test_tipc/prepare.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_whole_infer' bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'lite_train_whole_infer'
``` ```
- 模式3:whole_infer,不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度; - 模式3:whole_infer,不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度;
```shell ```shell
bash test_tipc/prepare.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'whole_infer' bash test_tipc/prepare.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'whole_infer'
# 用法1: # 用法1:
bash test_tipc/test_train_inference_python.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'whole_infer' bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'whole_infer'
# 用法2: 指定GPU卡预测,第三个传入参数为GPU卡号 # 用法2: 指定GPU卡预测,第三个传入参数为GPU卡号
bash test_tipc/test_train_inference_python.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'whole_infer' '1' bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'whole_infer' '1'
``` ```
- 模式4:whole_train_whole_infer,CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度; - 模式4:whole_train_whole_infer,CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
```shell ```shell
bash test_tipc/prepare.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'whole_train_whole_infer' bash test_tipc/prepare.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'whole_train_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'whole_train_whole_infer' bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'whole_train_whole_infer'
``` ```
- 模式5: klquant_whole_infer,测试离线量化; - 模式5: klquant_whole_infer,测试离线量化;
```shell ```shell
bash test_tipc/prepare.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'klquant_whole_infer' bash test_tipc/prepare.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'klquant_whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/config/ResNet/ResNet50_vd_train_infer_python.txt 'klquant_whole_infer' bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ResNet/ResNet50_vd_train_infer_python.txt 'klquant_whole_infer'
``` ```
......
...@@ -79,7 +79,7 @@ Linux GPU/CPU PACT量化训练推理测试的主程序为`test_train_inference_p ...@@ -79,7 +79,7 @@ Linux GPU/CPU PACT量化训练推理测试的主程序为`test_train_inference_p
### 2.2 准备数据和模型 ### 2.2 准备数据和模型
```bash ```bash
bash test_tipc/prepare.sh test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_pact_infer_python.txt lite_train_lite_infer bash test_tipc/prepare.sh test_tipc/configs/PPLCNetV2/PPLCNetV2_base_train_pact_infer_python.txt lite_train_lite_infer
``` ```
在线量化的操作流程,可参考[文档](../../deploy/slim/README.md) 在线量化的操作流程,可参考[文档](../../deploy/slim/README.md)
...@@ -89,7 +89,7 @@ bash test_tipc/prepare.sh test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_pact_i ...@@ -89,7 +89,7 @@ bash test_tipc/prepare.sh test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_pact_i
`MobileNetV3_large_x1_0``Linux GPU/CPU PACT在线量化训练推理测试`为例,命令如下所示。 `MobileNetV3_large_x1_0``Linux GPU/CPU PACT在线量化训练推理测试`为例,命令如下所示。
```bash ```bash
bash test_tipc/test_train_inference_python.sh test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_pact_infer_python.txt lite_train_lite_infer bash test_tipc/test_train_inference_python.sh test_tipc/configs/PPLCNetV2/PPLCNetV2_base_train_pact_infer_python.txt lite_train_lite_infer
``` ```
输出结果如下,表示命令运行成功。 输出结果如下,表示命令运行成功。
......
...@@ -80,7 +80,7 @@ Linux GPU/CPU KL离线量化推理测试的主程序为`test_ptq_inference_pytho ...@@ -80,7 +80,7 @@ Linux GPU/CPU KL离线量化推理测试的主程序为`test_ptq_inference_pytho
### 2.2 准备数据和模型 ### 2.2 准备数据和模型
```bash ```bash
bash test_tipc/prepare.sh test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_train_ptq_infer_python.txt whole_infer bash test_tipc/prepare.sh test_tipc/configs/MobileNetV3/MobileNetV3_large_x1_0_train_ptq_infer_python.txt whole_infer
``` ```
离线量化的操作流程,可参考[文档](../../deploy/slim/README.md) 离线量化的操作流程,可参考[文档](../../deploy/slim/README.md)
...@@ -90,7 +90,7 @@ bash test_tipc/prepare.sh test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_tr ...@@ -90,7 +90,7 @@ bash test_tipc/prepare.sh test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_tr
`MobileNetV3_large_x1_0``Linux GPU/CPU KL离线量化训练推理测试`为例,命令如下所示。 `MobileNetV3_large_x1_0``Linux GPU/CPU KL离线量化训练推理测试`为例,命令如下所示。
```bash ```bash
bash test_tipc/test_ptq_inference_python.sh test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_train_ptq_infer_python.txt whole_infer bash test_tipc/test_ptq_inference_python.sh test_tipc/configs/MobileNetV3/MobileNetV3_large_x1_0_train_ptq_infer_python.txt whole_infer
``` ```
输出结果如下,表示命令运行成功。 输出结果如下,表示命令运行成功。
......
...@@ -85,12 +85,18 @@ if [[ ${MODE} = "cpp_infer" ]]; then ...@@ -85,12 +85,18 @@ if [[ ${MODE} = "cpp_infer" ]]; then
if [[ ! -d "./deploy/cpp/paddle_inference/" ]]; then if [[ ! -d "./deploy/cpp/paddle_inference/" ]]; then
pushd ./deploy/cpp/ pushd ./deploy/cpp/
PADDLEInfer=$3 PADDLEInfer=$3
if [ "" = "$PADDLEInfer" ];then if [ "" = "$PADDLEInfer" ]; then
wget -nc https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/GPU/x86-64_gcc8.2_avx_mkl_cuda10.1_cudnn7.6.5_trt6.0.1.5/paddle_inference.tgz --no-check-certificate wget -nc https://paddle-inference-lib.bj.bcebos.com/2.2.2/cxx_c/Linux/GPU/x86-64_gcc8.2_avx_mkl_cuda10.1_cudnn7.6.5_trt6.0.1.5/paddle_inference.tgz --no-check-certificate
tar xf paddle_inference.tgz
else else
wget -nc ${PADDLEInfer} --no-check-certificate wget -nc ${PADDLEInfer} --no-check-certificate
tar_name=$(func_get_url_file_name "$PADDLEInfer")
tar xf ${tar_name}
paddle_inference_install_dir=${tar_name%.*}
if [ ! -d "paddle_inference" ]; then
ln -s ${paddle_inference_install_dir} paddle_inference
fi
fi fi
tar xf paddle_inference.tgz
popd popd
fi fi
if [[ $FILENAME == *infer_cpp_linux_gpu_cpu.txt ]]; then if [[ $FILENAME == *infer_cpp_linux_gpu_cpu.txt ]]; then
...@@ -311,6 +317,22 @@ if [[ ${MODE} = "paddle2onnx_infer" ]]; then ...@@ -311,6 +317,22 @@ if [[ ${MODE} = "paddle2onnx_infer" ]]; then
${python_name} -m pip install paddle2onnx ${python_name} -m pip install paddle2onnx
${python_name} -m pip install onnxruntime ${python_name} -m pip install onnxruntime
if [[ ${model_name} =~ "GeneralRecognition" ]]; then
cd dataset
rm -rf Aliproduct
rm -rf train_reg_all_data.txt
rm -rf demo_train
wget -nc https://paddle-imagenet-models-name.bj.bcebos.com/data/whole_chain/tipc_shitu_demo_data.tar --no-check-certificate
tar -xf tipc_shitu_demo_data.tar
ln -s tipc_shitu_demo_data Aliproduct
ln -s tipc_shitu_demo_data/demo_train.txt train_reg_all_data.txt
ln -s tipc_shitu_demo_data/demo_train demo_train
cd tipc_shitu_demo_data
ln -s demo_test.txt val_list.txt
cd ../../
eval "wget -nc $model_url_value --no-check-certificate"
mv general_PPLCNet_x2_5_pretrained_v1.0.pdparams GeneralRecognition_PPLCNet_x2_5_pretrained.pdparams
fi
cd deploy cd deploy
mkdir models mkdir models
cd models cd models
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
source test_tipc/common_func.sh source test_tipc/common_func.sh
FILENAME=$1 FILENAME=$1
MODE=$2
# parser params # parser params
dataline=$(awk 'NR==1, NR==16{print}' $FILENAME) dataline=$(awk 'NR==1, NR==16{print}' $FILENAME)
...@@ -35,7 +36,7 @@ inference_hardware_value=$(func_parser_value "${lines[14]}") ...@@ -35,7 +36,7 @@ inference_hardware_value=$(func_parser_value "${lines[14]}")
inference_config_key=$(func_parser_key "${lines[15]}") inference_config_key=$(func_parser_key "${lines[15]}")
inference_config_value=$(func_parser_value "${lines[15]}") inference_config_value=$(func_parser_value "${lines[15]}")
LOG_PATH="./test_tipc/output/${model_name}" LOG_PATH="./test_tipc/output/${model_name}/${MODE}"
mkdir -p ${LOG_PATH} mkdir -p ${LOG_PATH}
status_log="${LOG_PATH}/results_paddle2onnx.log" status_log="${LOG_PATH}/results_paddle2onnx.log"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册