From 9477468a6c15d9195ccde2427e934d59a3e0c855 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Thu, 28 Oct 2021 08:23:42 +0000 Subject: [PATCH 1/3] fix bug --- test_tipc/configs/ppocr_det_mobile_params.txt | 14 +++++++------- test_tipc/prepare.sh | 9 +++++---- test_tipc/test_train_inference_python.sh | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test_tipc/configs/ppocr_det_mobile_params.txt b/test_tipc/configs/ppocr_det_mobile_params.txt index 94d54411d3..9b04a85273 100644 --- a/test_tipc/configs/ppocr_det_mobile_params.txt +++ b/test_tipc/configs/ppocr_det_mobile_params.txt @@ -1,7 +1,7 @@ ===========================train_params=========================== model_name:ocr_det python:python3.7 -gpu_list:0|0,1|10.21.226.181,10.21.226.133;0,1 +gpu_list:0|0,1 Global.use_gpu:True|True|True Global.auto_cast:fp32|amp Global.epoch_num:lite_train_infer=1|whole_train_infer=300 @@ -13,9 +13,9 @@ train_infer_img_dir:./train_data/icdar2015/text_localization/ch4_test_images/ null:null ## trainer:norm_train|pact_train|fpgm_train -norm_train:tools/train.py -c tests/configs/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained -pact_train:deploy/slim/quantization/quant.py -c tests/configs/det_mv3_db.yml -o -fpgm_train:deploy/slim/prune/sensitivity_anal.py -c tests/configs/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/det_mv3_db_v2.0_train/best_accuracy +norm_train:tools/train.py -c test_tipc/configs/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained +pact_train:deploy/slim/quantization/quant.py -c test_tipc/configs/det_mv3_db.yml -o +fpgm_train:deploy/slim/prune/sensitivity_anal.py -c test_tipc/configs/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/det_mv3_db_v2.0_train/best_accuracy distill_train:null null:null null:null @@ -27,9 +27,9 @@ null:null ===========================infer_params=========================== Global.save_inference_dir:./output/ Global.pretrained_model: -norm_export:tools/export_model.py -c tests/configs/det_mv3_db.yml -o -quant_export:deploy/slim/quantization/export_model.py -c tests/configs/det_mv3_db.yml -o -fpgm_export:deploy/slim/prune/export_prune_model.py -c tests/configs/det_mv3_db.yml -o +norm_export:tools/export_model.py -c test_tipc/configs/det_mv3_db.yml -o +quant_export:deploy/slim/quantization/export_model.py -c test_tipc/configs/det_mv3_db.yml -o +fpgm_export:deploy/slim/prune/export_prune_model.py -c test_tipc/configs/det_mv3_db.yml -o distill_export:null export1:null export2:null diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index 4440b60274..fba898e0ff 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -119,10 +119,9 @@ elif [ ${MODE} = "whole_infer" ];then wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../ - fi - -elif [ ${MODE} = "klquant_whole_infer" ];then + fi +if [ ${MODE} = "klquant_whole_infer" ]; then if [ ${model_name} = "ocr_det" ]; then wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar @@ -134,7 +133,9 @@ elif [ ${MODE} = "klquant_whole_infer" ];then wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_det_infer.tar cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../ fi -elif [ ${MODE} = "cpp_infer" ];then +fi + +if [ ${MODE} = "cpp_infer" ];then if [ ${model_name} = "ocr_det" ]; then wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index 51768074d2..83b2d0abfc 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -source tests/common_func.sh +source test_tipc/common_func.sh FILENAME=$1 # MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', 'whole_infer', 'klquant_whole_infer'] From ec683abdfd467d8fe634ea8e773ad2e8255e713f Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Thu, 28 Oct 2021 08:31:35 +0000 Subject: [PATCH 2/3] add distribute training --- test_tipc/configs/ppocr_det_mobile_params.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_tipc/configs/ppocr_det_mobile_params.txt b/test_tipc/configs/ppocr_det_mobile_params.txt index 9b04a85273..9926b2e59b 100644 --- a/test_tipc/configs/ppocr_det_mobile_params.txt +++ b/test_tipc/configs/ppocr_det_mobile_params.txt @@ -1,7 +1,7 @@ ===========================train_params=========================== model_name:ocr_det python:python3.7 -gpu_list:0|0,1 +gpu_list:0|0,1|10.21.226.181,10.21.226.133;0,1 Global.use_gpu:True|True|True Global.auto_cast:fp32|amp Global.epoch_num:lite_train_infer=1|whole_train_infer=300 From 6335209b5a41c65072a97d78b28e637fe92b459d Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Thu, 28 Oct 2021 09:36:50 +0000 Subject: [PATCH 3/3] rename --- test_tipc/test_inference_cpp.sh | 4 ++-- test_tipc/test_serving.sh | 6 +++--- test_tipc/test_train_inference_python.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test_tipc/test_inference_cpp.sh b/test_tipc/test_inference_cpp.sh index 124bdacb7d..3f8b54b189 100644 --- a/test_tipc/test_inference_cpp.sh +++ b/test_tipc/test_inference_cpp.sh @@ -1,5 +1,5 @@ #!/bin/bash -source tests/common_func.sh +source test_tipc/common_func.sh FILENAME=$1 dataline=$(awk 'NR==52, NR==66{print}' $FILENAME) @@ -35,7 +35,7 @@ cpp_benchmark_key=$(func_parser_key "${lines[14]}") cpp_benchmark_value=$(func_parser_value "${lines[14]}") -LOG_PATH="./tests/output" +LOG_PATH="./test_tipc/output" mkdir -p ${LOG_PATH} status_log="${LOG_PATH}/results_cpp.log" diff --git a/test_tipc/test_serving.sh b/test_tipc/test_serving.sh index af66d70d7b..be7b594c38 100644 --- a/test_tipc/test_serving.sh +++ b/test_tipc/test_serving.sh @@ -1,5 +1,5 @@ #!/bin/bash -source PTDN/common_func.sh +source test_tipc/common_func.sh FILENAME=$1 dataline=$(awk 'NR==67, NR==83{print}' $FILENAME) @@ -36,8 +36,8 @@ web_precision_key=$(func_parser_key "${lines[15]}") web_precision_list=$(func_parser_value "${lines[15]}") pipeline_py=$(func_parser_value "${lines[16]}") -LOG_PATH="../../PTDN/output" -mkdir -p ./PTDN/output +LOG_PATH="../../test_tipc/output" +mkdir -p ./test_tipc/output status_log="${LOG_PATH}/results_serving.log" function func_serving(){ diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index 83b2d0abfc..a9be33ea45 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -120,7 +120,7 @@ if [ ${MODE} = "klquant_whole_infer" ]; then infer_value1=$(func_parser_value "${lines[15]}") fi -LOG_PATH="./tests/output" +LOG_PATH="./test_tipc/output" mkdir -p ${LOG_PATH} status_log="${LOG_PATH}/results_python.log"