From 6d1085a47ac843049f40e8933b4181fd45157918 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Mon, 8 Nov 2021 14:59:25 +0800 Subject: [PATCH 1/7] fix sast run bug --- configs/det/det_r50_vd_sast_icdar15.yml | 2 +- configs/det/det_r50_vd_sast_totaltext.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/det/det_r50_vd_sast_icdar15.yml b/configs/det/det_r50_vd_sast_icdar15.yml index dbfcefca96..674de7fbf2 100755 --- a/configs/det/det_r50_vd_sast_icdar15.yml +++ b/configs/det/det_r50_vd_sast_icdar15.yml @@ -8,7 +8,7 @@ Global: # evaluation is run every 5000 iterations after the 4000th iteration eval_batch_step: [4000, 5000] cal_metric_during_train: False - pretrained_model: ./pretrain_models/ResNet50_vd_ssld_pretrained/ + pretrained_model: ./pretrain_models/ResNet50_vd_ssld_pretrained checkpoints: save_inference_dir: use_visualdl: False diff --git a/configs/det/det_r50_vd_sast_totaltext.yml b/configs/det/det_r50_vd_sast_totaltext.yml index 88dd31f3c2..44a0766b1b 100755 --- a/configs/det/det_r50_vd_sast_totaltext.yml +++ b/configs/det/det_r50_vd_sast_totaltext.yml @@ -8,7 +8,7 @@ Global: # evaluation is run every 5000 iterations after the 4000th iteration eval_batch_step: [4000, 5000] cal_metric_during_train: False - pretrained_model: ./pretrain_models/ResNet50_vd_ssld_pretrained/ + pretrained_model: ./pretrain_models/ResNet50_vd_ssld_pretrained checkpoints: save_inference_dir: use_visualdl: False From 7a6349e67fb094ce125b5235de51b601e71730be Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Mon, 8 Nov 2021 19:07:20 +0800 Subject: [PATCH 2/7] add jeston params.txt --- .../jeston_ppocr_det_mobile_params.txt | 51 +++++++++++++++++++ test_tipc/prepare.sh | 3 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 test_tipc/configs/jeston_ppocr_det_mobile_params.txt diff --git a/test_tipc/configs/jeston_ppocr_det_mobile_params.txt b/test_tipc/configs/jeston_ppocr_det_mobile_params.txt new file mode 100644 index 0000000000..e79d6283f0 --- /dev/null +++ b/test_tipc/configs/jeston_ppocr_det_mobile_params.txt @@ -0,0 +1,51 @@ +===========================train_params=========================== +model_name:ocr_det +python:python +gpu_list:null +Global.use_gpu:False +Global.auto_cast:null +Global.epoch_num:null +Global.save_model_dir:null +Train.loader.batch_size_per_card:null +Global.pretrained_model:null +train_model_name:latest +train_infer_img_dir:null +null:null +## +trainer:null +norm_train:null +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================infer_params=========================== +Global.save_inference_dir:./output/ +Global.pretrained_model:null +norm_export:null +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +inference_dir:null +train_model:./inference/ch_ppocr_mobile_v2.0_det_infer +infer_export:null +infer_quant:False +inference:tools/infer/predict_det.py +--use_gpu:True +--enable_mkldnn:False +--cpu_threads:6 +--rec_batch_num:1 +--use_tensorrt:False|True +--precision:fp16|fp32 +--det_model_dir: +--image_dir:./inference/ch_det_data_50/all-sum-510/ +null:null +--benchmark:True +null:null diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index c9a38e01c9..312a9491bc 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -87,7 +87,8 @@ elif [ ${MODE} = "whole_infer" ];then rm -rf ./train_data/icdar2015 wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_train.tar --no-check-certificate - cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && cd ../ + wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar --no-check-certificate + cd ./inference && tar xf ${eval_model_name}.tar && tar xf ch_det_data_50.tar && tar xf ch_ppocr_mobile_v2.0_det_infer.tar && cd ../ elif [ ${model_name} = "ocr_server_det" ]; then wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar --no-check-certificate wget -nc -P ./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar --no-check-certificate From 4cb2179b7377587ef0d6b67f65de4b70e893dbdb Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Mon, 8 Nov 2021 19:35:15 +0800 Subject: [PATCH 3/7] set reasonable trt shape --- tools/infer/utility.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 41a3c0f14b..b74f75c207 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -193,7 +193,7 @@ def create_predictor(args, mode, logger): "nearest_interp_v2_0.tmp_0": [1, 256, 2, 2] } max_input_shape = { - "x": [1, 3, 2000, 2000], + "x": [1, 3, 1280, 1280], "conv2d_92.tmp_0": [1, 120, 400, 400], "conv2d_91.tmp_0": [1, 24, 200, 200], "conv2d_59.tmp_0": [1, 96, 400, 400], @@ -243,16 +243,16 @@ def create_predictor(args, mode, logger): opt_input_shape.update(opt_pact_shape) elif mode == "rec": min_input_shape = {"x": [1, 3, 32, 10]} - max_input_shape = {"x": [args.rec_batch_num, 3, 32, 2000]} + max_input_shape = {"x": [args.rec_batch_num, 3, 32, 1024]} opt_input_shape = {"x": [args.rec_batch_num, 3, 32, 320]} elif mode == "cls": min_input_shape = {"x": [1, 3, 48, 10]} - max_input_shape = {"x": [args.rec_batch_num, 3, 48, 2000]} + max_input_shape = {"x": [args.rec_batch_num, 3, 48, 1024]} opt_input_shape = {"x": [args.rec_batch_num, 3, 48, 320]} else: min_input_shape = {"x": [1, 3, 10, 10]} - max_input_shape = {"x": [1, 3, 1000, 1000]} - opt_input_shape = {"x": [1, 3, 500, 500]} + max_input_shape = {"x": [1, 3, 512, 512]} + opt_input_shape = {"x": [1, 3, 256, 256]} config.set_trt_dynamic_shape_info(min_input_shape, max_input_shape, opt_input_shape) From 707d0769a53718ffa65c041854484762284b4c1b Mon Sep 17 00:00:00 2001 From: stephon Date: Tue, 9 Nov 2021 11:17:56 +0000 Subject: [PATCH 4/7] update muti_node log name --- test_tipc/test_train_inference_python.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index eaeaf9684b..0bb73690bd 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -303,8 +303,16 @@ else set_batchsize=$(func_set_params "${train_batch_key}" "${train_batch_value}") set_train_params1=$(func_set_params "${train_param_key1}" "${train_param_value1}") set_use_gpu=$(func_set_params "${train_use_gpu_key}" "${use_gpu}") - save_log="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}" - + if [ ${#ips} -le 26 ];then + save_log="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}" + else + IFS="," + ips_array=(${ips}) + IFS="|" + nodes=${#ips_array[@]} + save_log="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}_nodes_${nodes}" + fi + # load pretrain from norm training if current trainer is pact or fpgm trainer if [ ${trainer} = ${pact_key} ] || [ ${trainer} = ${fpgm_key} ]; then set_pretrain="${load_norm_train_model}" From 50bf55fda2b4c260f2e330208840b182a6646749 Mon Sep 17 00:00:00 2001 From: stephon Date: Tue, 9 Nov 2021 12:24:20 +0000 Subject: [PATCH 5/7] update test_train_inference_python.sh --- test_tipc/test_train_inference_python.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index 0bb73690bd..d032bdeac7 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -244,7 +244,7 @@ else export Count=0 USE_GPU_KEY=(${train_use_gpu_value}) for gpu in ${gpu_list[*]}; do - use_gpu=${USE_GPU_KEY[Count]} + train_use_gpu=${USE_GPU_KEY[Count]} Count=$(($Count + 1)) ips="" if [ ${gpu} = "-1" ];then @@ -302,9 +302,10 @@ else set_pretrain=$(func_set_params "${pretrain_model_key}" "${pretrain_model_value}") set_batchsize=$(func_set_params "${train_batch_key}" "${train_batch_value}") set_train_params1=$(func_set_params "${train_param_key1}" "${train_param_value1}") - set_use_gpu=$(func_set_params "${train_use_gpu_key}" "${use_gpu}") + set_use_gpu=$(func_set_params "${train_use_gpu_key}" "${train_use_gpu}") if [ ${#ips} -le 26 ];then save_log="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}" + nodes=1 else IFS="," ips_array=(${ips}) @@ -314,7 +315,7 @@ else fi # load pretrain from norm training if current trainer is pact or fpgm trainer - if [ ${trainer} = ${pact_key} ] || [ ${trainer} = ${fpgm_key} ]; then + if ([ ${trainer} = ${pact_key} ] || [ ${trainer} = ${fpgm_key} ]) && [ ${nodes} -le 1 ]; then set_pretrain="${load_norm_train_model}" fi @@ -333,7 +334,7 @@ else set_eval_pretrain=$(func_set_params "${pretrain_model_key}" "${save_log}/${train_model_name}") # save norm trained models to set pretrain for pact training and fpgm training - if [ ${trainer} = ${trainer_norm} ]; then + if [ ${trainer} = ${trainer_norm} ] && [ ${nodes} -le 1]; then load_norm_train_model=${set_eval_pretrain} fi # run eval From c5ea2f693b0c7082fb8a784ffe1b0e1229796a43 Mon Sep 17 00:00:00 2001 From: MissPenguin Date: Wed, 10 Nov 2021 02:43:11 +0000 Subject: [PATCH 6/7] rename params files --- .../model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt | 0 .../model_linux_gpu_normal_normal_infer_python_jetson.txt | 0 .../model_linux_gpu_normal_normal_infer_python_mac.txt | 0 .../model_linux_gpu_normal_normal_lite_java_metal_arm_gpu.txt | 0 .../model_linux_gpu_normal_normal_lite_java_opencl_arm_gpu.txt | 0 ...model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt | 0 test_tipc/configs/ppocr_det_mobile/train_infer_python.txt | 0 .../train_linux_dcu_normal_normal_infer_python_dcu.txt | 0 .../train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt | 0 9 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_jetson.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_mac.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_lite_java_metal_arm_gpu.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_lite_java_opencl_arm_gpu.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/train_infer_python.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/train_linux_dcu_normal_normal_infer_python_dcu.txt create mode 100644 test_tipc/configs/ppocr_det_mobile/train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_cpp_linux_gpu_cpu.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_jetson.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_jetson.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_mac.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_infer_python_mac.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_lite_java_metal_arm_gpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_lite_java_metal_arm_gpu.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_lite_java_opencl_arm_gpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_lite_java_opencl_arm_gpu.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/train_infer_python.txt b/test_tipc/configs/ppocr_det_mobile/train_infer_python.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/train_linux_dcu_normal_normal_infer_python_dcu.txt b/test_tipc/configs/ppocr_det_mobile/train_linux_dcu_normal_normal_infer_python_dcu.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test_tipc/configs/ppocr_det_mobile/train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_det_mobile/train_linux_gpu_fleet_amp_infer_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000..e69de29bb2 From 9874b6c05816b6a804c47f86c610d042ba0414c1 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Wed, 10 Nov 2021 15:38:47 +0800 Subject: [PATCH 7/7] rename params txt --- ...mal_normal_paddle2onnx_python_linux_cpu.txt | 12 ++++++++++++ ...mal_normal_serving_python_linux_gpu_cpu.txt | 18 ++++++++++++++++++ ...mal_normal_paddle2onnx_python_linux_cpu.txt | 12 ++++++++++++ ...mal_normal_serving_python_linux_gpu_cpu.txt | 18 ++++++++++++++++++ ...mal_normal_paddle2onnx_python_linux_cpu.txt | 12 ++++++++++++ ...mal_normal_serving_python_linux_gpu_cpu.txt | 18 ++++++++++++++++++ ...mal_normal_paddle2onnx_python_linux_cpu.txt | 12 ++++++++++++ ...mal_normal_serving_python_linux_gpu_cpu.txt | 18 ++++++++++++++++++ test_tipc/docs/test_paddle2onnx.md | 4 ++-- test_tipc/docs/test_serving.md | 4 ++-- test_tipc/test_paddle2onnx.sh | 2 +- test_tipc/test_serving.sh | 2 +- 12 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt create mode 100644 test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt create mode 100644 test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt create mode 100644 test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt create mode 100644 test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt create mode 100644 test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt create mode 100644 test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt new file mode 100644 index 0000000000..2d1a59920a --- /dev/null +++ b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt @@ -0,0 +1,12 @@ +===========================paddle2onnx_params=========================== +2onnx: paddle2onnx +--model_dir:./inference/ch_ppocr_mobile_v2.0_det_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--save_file:./inference/det_mobile_onnx/model.onnx +--opset_version:10 +--enable_onnx_checker:True +inference:tools/infer/predict_det.py +--use_gpu:True|False +--det_model_dir: +--image_dir:./inference/ch_det_data_50/all-sum-510/ \ No newline at end of file diff --git a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt index e69de29bb2..a19c8ee335 100644 --- a/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt +++ b/test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt @@ -0,0 +1,18 @@ +===========================serving_params=========================== +model_name:ocr_det_mobile +python:python3.7|cpp +trans_model:-m paddle_serving_client.convert +--dirname:./inference/ch_ppocr_mobile_v2.0_det_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./deploy/pdserving/ppocr_det_mobile_2.0_serving/ +--serving_client:./deploy/pdserving/ppocr_det_mobile_2.0_client/ +serving_dir:./deploy/pdserving +web_service:web_service_det.py --config=config.yml --opt op.det.concurrency=1 +op.det.local_service_conf.devices:null|0 +op.det.local_service_conf.use_mkldnn:True|False +op.det.local_service_conf.thread_num:1|6 +op.det.local_service_conf.use_trt:False|True +op.det.local_service_conf.precision:fp32|fp16|int8 +pipline:pipeline_rpc_client.py|pipeline_http_client.py +--image_dir:../../doc/imgs \ No newline at end of file diff --git a/test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt b/test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt new file mode 100644 index 0000000000..919736085b --- /dev/null +++ b/test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt @@ -0,0 +1,12 @@ +===========================paddle2onnx_params=========================== +2onnx: paddle2onnx +--model_dir:./inference/ch_ppocr_server_v2.0_det_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--save_file:./inference/det_server_onnx/model.onnx +--opset_version:10 +--enable_onnx_checker:True +inference:tools/infer/predict_det.py +--use_gpu:True|False +--det_model_dir: +--image_dir:./inference/det_inference \ No newline at end of file diff --git a/test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000..09b7ab7504 --- /dev/null +++ b/test_tipc/configs/ppocr_det_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt @@ -0,0 +1,18 @@ +===========================serving_params=========================== +model_name:ocr_det_server +python:python3.7|cpp +trans_model:-m paddle_serving_client.convert +--dirname:./inference/ch_ppocr_server_v2.0_det_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./deploy/pdserving/ppocr_det_server_2.0_serving/ +--serving_client:./deploy/pdserving/ppocr_det_server_2.0_client/ +serving_dir:./deploy/pdserving +web_service:web_service_det.py --config=config.yml --opt op.det.concurrency=1 +op.det.local_service_conf.devices:null|0 +op.det.local_service_conf.use_mkldnn:True|False +op.det.local_service_conf.thread_num:1|6 +op.det.local_service_conf.use_trt:False|True +op.det.local_service_conf.precision:fp32|fp16|int8 +pipline:pipeline_rpc_client.py|pipeline_http_client.py +--image_dir:../../doc/imgs_words_en \ No newline at end of file diff --git a/test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt b/test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt new file mode 100644 index 0000000000..69bd018623 --- /dev/null +++ b/test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt @@ -0,0 +1,12 @@ +===========================paddle2onnx_params=========================== +2onnx: paddle2onnx +--model_dir:./inference/ch_ppocr_mobile_v2.0_rec_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--save_file:./inference/rec_mobile_onnx/model.onnx +--opset_version:10 +--enable_onnx_checker:True +inference:tools/infer/predict_rec.py +--use_gpu:True|False +--rec_model_dir: +--image_dir:./inference/rec_inference \ No newline at end of file diff --git a/test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000..7351e5bd6d --- /dev/null +++ b/test_tipc/configs/ppocr_rec_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt @@ -0,0 +1,18 @@ +===========================serving_params=========================== +model_name:ocr_rec_mobile +python:python3.7|cpp +trans_model:-m paddle_serving_client.convert +--dirname:./inference/ch_ppocr_mobile_v2.0_rec_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./deploy/pdserving/ppocr_rec_mobile_2.0_serving/ +--serving_client:./deploy/pdserving/ppocr_rec_mobile_2.0_client/ +serving_dir:./deploy/pdserving +web_service:web_service_rec.py --config=config.yml --opt op.rec.concurrency=1 +op.rec.local_service_conf.devices:null|0 +op.rec.local_service_conf.use_mkldnn:True|False +op.rec.local_service_conf.thread_num:1|6 +op.rec.local_service_conf.use_trt:False|True +op.rec.local_service_conf.precision:fp32|fp16|int8 +pipline:pipeline_rpc_client.py|pipeline_http_client.py +--image_dir:../../doc/imgs_words_en \ No newline at end of file diff --git a/test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt b/test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt new file mode 100644 index 0000000000..16411aca52 --- /dev/null +++ b/test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt @@ -0,0 +1,12 @@ +===========================paddle2onnx_params=========================== +2onnx: paddle2onnx +--model_dir:./inference/ch_ppocr_server_v2.0_rec_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--save_file:./inference/rec_server_onnx/model.onnx +--opset_version:10 +--enable_onnx_checker:True +inference:tools/infer/predict_rec.py +--use_gpu:True|False +--rec_model_dir: +--image_dir:./inference/rec_inference \ No newline at end of file diff --git a/test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt b/test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt new file mode 100644 index 0000000000..24e7a8f3e0 --- /dev/null +++ b/test_tipc/configs/ppocr_rec_server/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt @@ -0,0 +1,18 @@ +===========================serving_params=========================== +model_name:ocr_rec_server +python:python3.7 +trans_model:-m paddle_serving_client.convert +--dirname:./inference/ch_ppocr_server_v2.0_rec_infer/ +--model_filename:inference.pdmodel +--params_filename:inference.pdiparams +--serving_server:./deploy/pdserving/ppocr_rec_server_2.0_serving/ +--serving_client:./deploy/pdserving/ppocr_rec_server_2.0_client/ +serving_dir:./deploy/pdserving +web_service:web_service_rec.py --config=config.yml --opt op.rec.concurrency=1 +op.rec.local_service_conf.devices:null|0 +op.rec.local_service_conf.use_mkldnn:True|False +op.rec.local_service_conf.thread_num:1|6 +op.rec.local_service_conf.use_trt:False|True +op.rec.local_service_conf.precision:fp32|fp16|int8 +pipline:pipeline_rpc_client.py|pipeline_http_client.py +--image_dir:../../doc/imgs_words_en \ No newline at end of file diff --git a/test_tipc/docs/test_paddle2onnx.md b/test_tipc/docs/test_paddle2onnx.md index 5d784c5e93..df2734771e 100644 --- a/test_tipc/docs/test_paddle2onnx.md +++ b/test_tipc/docs/test_paddle2onnx.md @@ -18,10 +18,10 @@ PaddleServing预测功能测试的主程序为`test_paddle2onnx.sh`,可以测 先运行`prepare.sh`准备数据和模型,然后运行`test_paddle2onnx.sh`进行测试,最终在```test_tipc/output```目录下生成`paddle2onnx_infer_*.log`后缀的日志文件。 ```shell -bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt "paddle2onnx_infer" +bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt "paddle2onnx_infer" # 用法: -bash test_tipc/test_paddle2onnx.sh ./test_tipc/configs/ppocr_det_mobile_params.txt +bash test_tipc/test_paddle2onnx.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt ``` #### 运行结果 diff --git a/test_tipc/docs/test_serving.md b/test_tipc/docs/test_serving.md index f63d6c7107..1eded6f582 100644 --- a/test_tipc/docs/test_serving.md +++ b/test_tipc/docs/test_serving.md @@ -20,10 +20,10 @@ PaddleServing预测功能测试的主程序为`test_serving.sh`,可以测试 先运行`prepare.sh`准备数据和模型,然后运行`test_serving.sh`进行测试,最终在```test_tipc/output```目录下生成`serving_infer_*.log`后缀的日志文件。 ```shell -bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt "serving_infer" +bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt "serving_infer" # 用法: -bash test_tipc/test_serving.sh ./test_tipc/configs/ppocr_det_mobile_params.txt +bash test_tipc/test_serving.sh ./test_tipc/configs/ppocr_det_mobile/model_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt ``` #### 运行结果 diff --git a/test_tipc/test_paddle2onnx.sh b/test_tipc/test_paddle2onnx.sh index 5dc6e65ec8..cd3cfc6120 100644 --- a/test_tipc/test_paddle2onnx.sh +++ b/test_tipc/test_paddle2onnx.sh @@ -11,7 +11,7 @@ python=$(func_parser_value "${lines[2]}") # parser params -dataline=$(awk 'NR==111, NR==123{print}' $FILENAME) +dataline=$(awk 'NR==1, NR==12{print}' $FILENAME) IFS=$'\n' lines=(${dataline}) diff --git a/test_tipc/test_serving.sh b/test_tipc/test_serving.sh index 9b1e90ed61..c36935a60f 100644 --- a/test_tipc/test_serving.sh +++ b/test_tipc/test_serving.sh @@ -2,7 +2,7 @@ source test_tipc/common_func.sh FILENAME=$1 -dataline=$(awk 'NR==67, NR==84{print}' $FILENAME) +dataline=$(awk 'NR==1, NR==18{print}' $FILENAME) # parser params IFS=$'\n'