From 7854510f39394a33895962f42f699715075cbc9e Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Tue, 11 Oct 2022 08:55:02 +0000
Subject: [PATCH 01/10] add kl for slanet and vi-layoutxlm
---
.../configs/slanet/train_ptq_infer_python.txt | 21 +++++++++++++++++++
.../train_ptq_infer_python.txt | 21 +++++++++++++++++++
test_tipc/prepare.sh | 12 +++++++++++
3 files changed, 54 insertions(+)
create mode 100644 test_tipc/configs/slanet/train_ptq_infer_python.txt
create mode 100644 test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt
diff --git a/test_tipc/configs/slanet/train_ptq_infer_python.txt b/test_tipc/configs/slanet/train_ptq_infer_python.txt
new file mode 100644
index 0000000000..c49a1d8843
--- /dev/null
+++ b/test_tipc/configs/slanet/train_ptq_infer_python.txt
@@ -0,0 +1,21 @@
+===========================train_params===========================
+model_name:slanet_KL
+python:python3.7
+Global.pretrained_model:
+Global.save_inference_dir:null
+infer_model:./inference/en_ppstructure_mobile_v2.0_SLANet_infer/
+infer_export:deploy/slim/quantization/quant_kl.py -c test_tipc/configs/slanet/SLANet.yml -o
+infer_quant:True
+inference:ppstructure/table/predict_table.py --det_model_dir=./inference/ch_PP-OCRv3_det_infer --rec_model_dir=./inference/ch_PP-OCRv3_rec_infer --rec_char_dict_path=./ppocr/utils/ppocr_keys_v1.txt --table_char_dict_path=./ppocr/utils/dict/table_structure_dict.txt --image_dir=./ppstructure/docs/table/table.jpg --det_limit_side_len=736 --det_limit_type=min --output ./output/table
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:int8
+--table_model_dir:
+--image_dir:./ppstructure/docs/table/table.jpg
+null:null
+--benchmark:False
+null:null
+null:null
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt b/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt
new file mode 100644
index 0000000000..eb12703534
--- /dev/null
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt
@@ -0,0 +1,21 @@
+===========================train_params===========================
+model_name:vi_layoutxlm_ser_KL
+python:python3.7
+Global.pretrained_model:
+Global.save_inference_dir:null
+infer_model:./inference/ser_vi_layoutxlm_xfund_infer/
+infer_export:deploy/slim/quantization/quant_kl.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o Train.loader.batch_size_per_card=1 Eval.loader.batch_size_per_card=1
+infer_quant:True
+inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM --ser_dict_path=train_data/XFUND/class_list_xfun.txt --output=output --ocr_order_method=tb-yx
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:int8
+--ser_model_dir:
+--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+--benchmark:False
+null:null
+null:null
diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh
index 688deac0f3..75009c98e6 100644
--- a/test_tipc/prepare.sh
+++ b/test_tipc/prepare.sh
@@ -532,6 +532,18 @@ elif [ ${MODE} = "whole_infer" ];then
fi
cd ../
fi
+ if [[ ${model_name} =~ "slanet" ]];then
+ wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_infer.tar --no-check-certificate
+ wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar --no-check-certificate
+ wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar --no-check-certificate
+ cd ./inference/ && tar xf en_ppstructure_mobile_v2.0_SLANet_infer.tar && tar xf ch_PP-OCRv3_det_infer.tar && tar xf ch_PP-OCRv3_rec_infer.tar && cd ../
+ fi
+ if [[ ${model_name} =~ "vi_layoutxlm_ser" ]]; then
+ ${python_name} -m pip install -r ppstructure/kie/requirements.txt
+ ${python_name} -m pip install opencv-python -U
+ wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/vi_layoutxlm/ser_vi_layoutxlm_xfund_infer.tar --no-check-certificate
+ cd ./inference/ && tar xf ser_vi_layoutxlm_xfund_infer.tar & cd ../
+ fi
if [[ ${model_name} =~ "layoutxlm_ser" ]]; then
${python_name} -m pip install -r ppstructure/kie/requirements.txt
${python_name} -m pip install opencv-python -U
From 5c6e25d8fe0de37871fa6d64eccaf57d1cb91dc3 Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Tue, 11 Oct 2022 09:06:54 +0000
Subject: [PATCH 02/10] support vi-layoutxlm fleet train
---
...leet_normal_infer_python_linux_gpu_cpu.txt | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
new file mode 100644
index 0000000000..b930135731
--- /dev/null
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
@@ -0,0 +1,53 @@
+===========================train_params===========================
+model_name:vi_layoutxlm_ser
+python:python3.7
+gpu_list:192.168.0.1,192.168.0.2;0,1
+Global.use_gpu:True|True
+Global.auto_cast:fp32
+Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=17
+Global.save_model_dir:./output/
+Train.loader.batch_size_per_card:lite_train_lite_infer=4|whole_train_whole_infer=8
+Architecture.Backbone.checkpoints:null
+train_model_name:latest
+train_infer_img_dir:ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+##
+trainer:norm_train
+norm_train:tools/train.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
+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/
+Architecture.Backbone.checkpoints:
+norm_export:tools/export_model.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
+quant_export:
+fpgm_export:
+distill_export:null
+export1:null
+export2:null
+##
+infer_model:null
+infer_export:null
+infer_quant:False
+inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM --ser_dict_path=train_data/XFUND/class_list_xfun.txt --output=output --ocr_order_method=tb-yx
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:fp32
+--ser_model_dir:
+--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+--benchmark:False
+null:null
+===========================infer_benchmark_params==========================
+random_infer_input:[{float32,[3,224,224]}]
From cf5dd4479c6412590e9a0c4ff93b2d0e7693571a Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Tue, 11 Oct 2022 09:08:36 +0000
Subject: [PATCH 03/10] add blank after -o
---
.../train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
index b930135731..65d927d20d 100644
--- a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
@@ -13,7 +13,7 @@ train_infer_img_dir:ppstructure/docs/kie/input/zh_val_42.jpg
null:null
##
trainer:norm_train
-norm_train:tools/train.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
+norm_train:tools/train.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
pact_train:null
fpgm_train:null
distill_train:null
From e8867631c202c131427136cbebff131d9c24075c Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Tue, 11 Oct 2022 09:52:39 +0000
Subject: [PATCH 04/10] relink kie link to inference
---
ppstructure/docs/quickstart.md | 2 +-
ppstructure/docs/quickstart_en.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ppstructure/docs/quickstart.md b/ppstructure/docs/quickstart.md
index 60642f78b6..74a3ff1aee 100644
--- a/ppstructure/docs/quickstart.md
+++ b/ppstructure/docs/quickstart.md
@@ -214,7 +214,7 @@ for line in result:
#### 2.2.5 关键信息抽取
-关键信息抽取暂不支持通过whl包调用,详细使用教程请参考:[关键信息抽取教程](../kie/README_ch.md)。
+关键信息抽取暂不支持通过whl包调用,详细使用教程请参考:[inference文档](./inference.md)。
diff --git a/ppstructure/docs/quickstart_en.md b/ppstructure/docs/quickstart_en.md
index e0eec4b38b..e6b1419cbf 100644
--- a/ppstructure/docs/quickstart_en.md
+++ b/ppstructure/docs/quickstart_en.md
@@ -94,7 +94,7 @@ paddleocr --image_dir=ppstructure/docs/table/table.jpg --type=structure --layout
#### 2.1.5 Key Information Extraction
-Key information extraction does not currently support use by the whl package. For detailed usage tutorials, please refer to: [Key Information Extraction](../kie/README.md).
+Key information extraction does not currently support use by the whl package. For detailed usage tutorials, please refer to: [inference document](./inference_en.md).
#### 2.1.6 layout recovery
From f8af1507e95b2385930208a35e56f8b1b4089365 Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Wed, 12 Oct 2022 02:42:39 +0000
Subject: [PATCH 05/10] add slanet and vi_layoutxlm_ser pact
---
.../slanet/train_pact_infer_python.txt | 53 +++++++++++++++++++
.../train_pact_infer_python.txt | 53 +++++++++++++++++++
test_tipc/prepare.sh | 8 ++-
3 files changed, 112 insertions(+), 2 deletions(-)
create mode 100644 test_tipc/configs/slanet/train_pact_infer_python.txt
create mode 100644 test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt
diff --git a/test_tipc/configs/slanet/train_pact_infer_python.txt b/test_tipc/configs/slanet/train_pact_infer_python.txt
new file mode 100644
index 0000000000..848d768a44
--- /dev/null
+++ b/test_tipc/configs/slanet/train_pact_infer_python.txt
@@ -0,0 +1,53 @@
+===========================train_params===========================
+model_name:slanet_PACT
+python:python3.7
+gpu_list:0|0,1
+Global.use_gpu:True|True
+Global.auto_cast:fp32
+Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=50
+Global.save_model_dir:./output/
+Train.loader.batch_size_per_card:lite_train_lite_infer=2|whole_train_whole_infer=2
+Global.pretrained_model:./pretrain_models/en_ppstructure_mobile_v2.0_SLANet_train/best_accuracy
+train_model_name:latest
+train_infer_img_dir:./ppstructure/docs/table/table.jpg
+null:null
+##
+trainer:pact_train
+norm_train:null
+pact_train:deploy/slim/quantization/quant.py -c test_tipc/configs/slanet/SLANet.yml -o
+fpgm_train:null
+distill_train:null
+null:null
+null:null
+##
+===========================eval_params===========================
+eval:null
+null:null
+##
+===========================infer_params===========================
+Global.save_inference_dir:./output/
+Global.checkpoints:
+norm_export:null
+quant_export:deploy/slim/quantization/export_model.py -c test_tipc/configs/slanet/SLANet.yml -o
+fpgm_export:
+distill_export:null
+export1:null
+export2:null
+##
+infer_model:./inference/en_ppocr_mobile_v2.0_table_structure_infer
+infer_export:null
+infer_quant:True
+inference:ppstructure/table/predict_table.py --det_model_dir=./inference/en_ppocr_mobile_v2.0_table_det_infer --rec_model_dir=./inference/en_ppocr_mobile_v2.0_table_rec_infer --rec_char_dict_path=./ppocr/utils/dict/table_dict.txt --table_char_dict_path=./ppocr/utils/dict/table_structure_dict.txt --image_dir=./ppstructure/docs/table/table.jpg --det_limit_side_len=736 --det_limit_type=min --output ./output/table
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:fp32
+--table_model_dir:
+--image_dir:./ppstructure/docs/table/table.jpg
+null:null
+--benchmark:False
+null:null
+===========================infer_benchmark_params==========================
+random_infer_input:[{float32,[3,488,488]}]
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt b/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt
new file mode 100644
index 0000000000..e711baa0f9
--- /dev/null
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt
@@ -0,0 +1,53 @@
+===========================train_params===========================
+model_name:vi_layoutxlm_ser_PACT
+python:python3.7
+gpu_list:0|0,1
+Global.use_gpu:True|True
+Global.auto_cast:fp32
+Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=17
+Global.save_model_dir:./output/
+Train.loader.batch_size_per_card:lite_train_lite_infer=4|whole_train_whole_infer=8
+Architecture.Backbone.pretrained:./pretrain_models/ser_vi_layoutxlm_xfund_pretrained/best_accuracy
+train_model_name:latest
+train_infer_img_dir:ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+##
+trainer:pact_train
+norm_train:null
+pact_train:deploy/slim/quantization/quant.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o Global.eval_batch_step=[2000,10]
+fpgm_train:null
+distill_train:null
+null:null
+null:null
+##
+===========================eval_params===========================
+eval:null
+null:null
+##
+===========================infer_params===========================
+Global.save_inference_dir:./output/
+Architecture.Backbone.checkpoints:
+norm_export:null
+quant_export:deploy/slim/quantization/export_model.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
+fpgm_export: null
+distill_export:null
+export1:null
+export2:null
+##
+infer_model:null
+infer_export:null
+infer_quant:False
+inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM --ser_dict_path=train_data/XFUND/class_list_xfun.txt --output=output --ocr_order_method=tb-yx
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:fp32
+--ser_model_dir:
+--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+--benchmark:False
+null:null
+===========================infer_benchmark_params==========================
+random_infer_input:[{float32,[3,224,224]}]
diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh
index 75009c98e6..e1d4487548 100644
--- a/test_tipc/prepare.sh
+++ b/test_tipc/prepare.sh
@@ -164,7 +164,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar --no-check-certificate
cd ./inference/ && tar xf en_ppocr_mobile_v2.0_table_det_infer.tar && tar xf en_ppocr_mobile_v2.0_table_rec_infer.tar && cd ../
fi
- if [ ${model_name} == "slanet" ];then
+ if [[ ${model_name} =~ "slanet" ]];then
wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_train.tar --no-check-certificate
cd ./pretrain_models/ && tar xf en_ppstructure_mobile_v2.0_SLANet_train.tar && cd ../
wget -nc -P ./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar --no-check-certificate
@@ -267,12 +267,16 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pplayout/ser_LayoutXLM_xfun_zh.tar --no-check-certificate
cd ./pretrain_models/ && tar xf ser_LayoutXLM_xfun_zh.tar && cd ../
fi
- if [ ${model_name} == "vi_layoutxlm_ser" ]; then
+ if [[ ${model_name} =~ "vi_layoutxlm_ser" ]]; then
${python_name} -m pip install -r ppstructure/kie/requirements.txt
${python_name} -m pip install opencv-python -U
wget -nc -P ./train_data/ https://paddleocr.bj.bcebos.com/ppstructure/dataset/XFUND.tar --no-check-certificate
cd ./train_data/ && tar xf XFUND.tar
cd ../
+ if [ ${model_name} == "vi_layoutxlm_ser_PACT" ]; then
+ wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/ppstructure/models/vi_layoutxlm/ser_vi_layoutxlm_xfund_pretrained.tar --no-check-certificate
+ cd ./pretrain_models/ && tar xf ser_vi_layoutxlm_xfund_pretrained.tar && cd ../
+ fi
fi
if [ ${model_name} == "det_r18_ct" ]; then
wget -nc -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams --no-check-certificate
From 89a9a3ce407ccf0b1e654fc6907cdb9fa745279e Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Wed, 12 Oct 2022 02:48:12 +0000
Subject: [PATCH 06/10] update slanet tipc config
---
test_tipc/configs/slanet/SLANet.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_tipc/configs/slanet/SLANet.yml b/test_tipc/configs/slanet/SLANet.yml
index 4ebfdd20f7..0d55d70d64 100644
--- a/test_tipc/configs/slanet/SLANet.yml
+++ b/test_tipc/configs/slanet/SLANet.yml
@@ -12,7 +12,7 @@ Global:
checkpoints:
save_inference_dir: ./output/SLANet/infer
use_visualdl: False
- infer_img: doc/table/table.jpg
+ infer_img: ppstructure/docs/table/table.jpg
# for data or label process
character_dict_path: ppocr/utils/dict/table_structure_dict.txt
character_type: en
From 5e8b4debee4fc4bf30a172ddaa4632b2982c2519 Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Wed, 12 Oct 2022 02:59:40 +0000
Subject: [PATCH 07/10] add slanet amp
---
..._normal_amp_infer_python_linux_gpu_cpu.txt | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
diff --git a/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
new file mode 100644
index 0000000000..279031bc50
--- /dev/null
+++ b/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
@@ -0,0 +1,53 @@
+===========================train_params===========================
+model_name:slanet
+python:python3.7
+gpu_list:0|0,1
+Global.use_gpu:True|True
+Global.auto_cast:amp
+Global.epoch_num:lite_train_lite_infer=3|whole_train_whole_infer=50
+Global.save_model_dir:./output/
+Train.loader.batch_size_per_card:lite_train_lite_infer=16|whole_train_whole_infer=128
+Global.pretrained_model:./pretrain_models/en_ppstructure_mobile_v2.0_SLANet_train/best_accuracy
+train_model_name:latest
+train_infer_img_dir:./ppstructure/docs/table/table.jpg
+null:null
+##
+trainer:norm_train
+norm_train:tools/train.py -c test_tipc/configs/slanet/SLANet.yml -o
+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.checkpoints:
+norm_export:tools/export_model.py -c test_tipc/configs/slanet/SLANet.yml -o
+quant_export:
+fpgm_export:
+distill_export:null
+export1:null
+export2:null
+##
+infer_model:./inference/en_ppstructure_mobile_v2.0_SLANet_train
+infer_export:null
+infer_quant:False
+inference:ppstructure/table/predict_table.py --det_model_dir=./inference/en_ppocr_mobile_v2.0_table_det_infer --rec_model_dir=./inference/en_ppocr_mobile_v2.0_table_rec_infer --rec_char_dict_path=./ppocr/utils/dict/table_dict.txt --table_char_dict_path=./ppocr/utils/dict/table_structure_dict.txt --image_dir=./ppstructure/docs/table/table.jpg --det_limit_side_len=736 --det_limit_type=min --output ./output/table
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:fp32
+--table_model_dir:
+--image_dir:./ppstructure/docs/table/table.jpg
+null:null
+--benchmark:False
+null:null
+===========================infer_benchmark_params==========================
+random_infer_input:[{float32,[3,488,488]}]
From c39f19d96549adcc7adb9e7a29d76ced21feef5f Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Wed, 12 Oct 2022 04:03:17 +0000
Subject: [PATCH 08/10] add vi_Layoutxlm_ser amp train
---
..._normal_amp_infer_python_linux_gpu_cpu.txt | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
new file mode 100644
index 0000000000..0367b55934
--- /dev/null
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
@@ -0,0 +1,53 @@
+===========================train_params===========================
+model_name:vi_layoutxlm_ser
+python:python3.7
+gpu_list:0|0,1
+Global.use_gpu:True|True
+Global.auto_cast:amp
+Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=17
+Global.save_model_dir:./output/
+Train.loader.batch_size_per_card:lite_train_lite_infer=4|whole_train_whole_infer=8
+Architecture.Backbone.checkpoints:null
+train_model_name:latest
+train_infer_img_dir:ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+##
+trainer:norm_train
+norm_train:tools/train.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
+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/
+Architecture.Backbone.checkpoints:
+norm_export:tools/export_model.py -c ./configs/kie/vi_layoutxlm/ser_vi_layoutxlm_xfund_zh.yml -o
+quant_export:
+fpgm_export:
+distill_export:null
+export1:null
+export2:null
+##
+infer_model:null
+infer_export:null
+infer_quant:False
+inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM --ser_dict_path=train_data/XFUND/class_list_xfun.txt --output=output --ocr_order_method=tb-yx
+--use_gpu:True|False
+--enable_mkldnn:False
+--cpu_threads:6
+--rec_batch_num:1
+--use_tensorrt:False
+--precision:fp32
+--ser_model_dir:
+--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
+null:null
+--benchmark:False
+null:null
+===========================infer_benchmark_params==========================
+random_infer_input:[{float32,[3,224,224]}]
From 2ff77ee3d6ceddb6e6c1e0173ce9923cea609101 Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Wed, 12 Oct 2022 06:14:34 +0000
Subject: [PATCH 09/10] set benchmark to true
---
.../train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt | 2 +-
test_tipc/configs/slanet/train_pact_infer_python.txt | 2 +-
test_tipc/configs/slanet/train_ptq_infer_python.txt | 2 +-
.../train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt | 2 +-
.../train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt | 2 +-
test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt | 2 +-
test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
index 279031bc50..f903f0d516 100644
--- a/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
+++ b/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
@@ -42,7 +42,7 @@ inference:ppstructure/table/predict_table.py --det_model_dir=./inference/en_ppoc
--enable_mkldnn:False
--cpu_threads:6
--rec_batch_num:1
---use_tensorrt:False
+--use_tensorrt:True
--precision:fp32
--table_model_dir:
--image_dir:./ppstructure/docs/table/table.jpg
diff --git a/test_tipc/configs/slanet/train_pact_infer_python.txt b/test_tipc/configs/slanet/train_pact_infer_python.txt
index 848d768a44..42ed0cf599 100644
--- a/test_tipc/configs/slanet/train_pact_infer_python.txt
+++ b/test_tipc/configs/slanet/train_pact_infer_python.txt
@@ -47,7 +47,7 @@ inference:ppstructure/table/predict_table.py --det_model_dir=./inference/en_ppoc
--table_model_dir:
--image_dir:./ppstructure/docs/table/table.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,488,488]}]
diff --git a/test_tipc/configs/slanet/train_ptq_infer_python.txt b/test_tipc/configs/slanet/train_ptq_infer_python.txt
index c49a1d8843..08188a8f3f 100644
--- a/test_tipc/configs/slanet/train_ptq_infer_python.txt
+++ b/test_tipc/configs/slanet/train_ptq_infer_python.txt
@@ -16,6 +16,6 @@ inference:ppstructure/table/predict_table.py --det_model_dir=./inference/ch_PP-O
--table_model_dir:
--image_dir:./ppstructure/docs/table/table.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
null:null
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
index 65d927d20d..74953ec273 100644
--- a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
@@ -47,7 +47,7 @@ inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM -
--ser_model_dir:
--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}]
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
index 0367b55934..95daa020fe 100644
--- a/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
@@ -47,7 +47,7 @@ inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM -
--ser_model_dir:
--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}]
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt b/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt
index e711baa0f9..c1fc48c211 100644
--- a/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_pact_infer_python.txt
@@ -47,7 +47,7 @@ inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM -
--ser_model_dir:
--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,224,224]}]
diff --git a/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt b/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt
index eb12703534..faae8713cf 100644
--- a/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt
+++ b/test_tipc/configs/vi_layoutxlm_ser/train_ptq_infer_python.txt
@@ -16,6 +16,6 @@ inference:ppstructure/kie/predict_kie_token_ser.py --kie_algorithm=LayoutXLM -
--ser_model_dir:
--image_dir:./ppstructure/docs/kie/input/zh_val_42.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
null:null
From aa7c00542198deadc841037c975d4886531d47a1 Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Wed, 12 Oct 2022 06:16:17 +0000
Subject: [PATCH 10/10] benckmark true
---
.../train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
index f903f0d516..f8d3eff698 100644
--- a/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
+++ b/test_tipc/configs/slanet/train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt
@@ -47,7 +47,7 @@ inference:ppstructure/table/predict_table.py --det_model_dir=./inference/en_ppoc
--table_model_dir:
--image_dir:./ppstructure/docs/table/table.jpg
null:null
---benchmark:False
+--benchmark:True
null:null
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,488,488]}]