From 638c853b02a99ddeab86590b3ebb5e45d0156cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91cyc=E5=AE=87?= <1251519599@qq.com> Date: Thu, 5 Jan 2023 10:20:20 +0000 Subject: [PATCH 1/6] update ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/benchmark_tf.sh. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黑cyc宇 <1251519599@qq.com> --- .../contrib/cv/Yolov5_for_ACL/offline_inference/benchmark_tf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/benchmark_tf.sh b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/benchmark_tf.sh index 02d60f420..dc8e5b9cd 100644 --- a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/benchmark_tf.sh +++ b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/benchmark_tf.sh @@ -8,7 +8,7 @@ fi run_script_file=$(readlink -f "$0") run_script_dir=$(dirname $run_script_file) -root_dir=$(dirname run_script_dir) +root_dir=$(dirname $run_script_dir) model_name=Yolov5 # 已下参数请根据实际路径修改 -- Gitee From 785a4ce9a2abdd1152abfbefd1e1055e98f17f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91cyc=E5=AE=87?= <1251519599@qq.com> Date: Thu, 5 Jan 2023 10:20:43 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/.keep diff --git a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/.keep b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From 51cdd9655568e2afe40ad343ea328294bb8e32c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91cyc=E5=AE=87?= <1251519599@qq.com> Date: Thu, 5 Jan 2023 10:29:21 +0000 Subject: [PATCH 3/6] update built-in/ACL_TensorFlow/Research/cv/TSN_for_ACL/data/classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黑cyc宇 <1251519599@qq.com> --- .../cv/Yolov5_for_ACL/data/classes/coco.names | 80 +++++++++++++++++++ .../cv/Yolov5_for_ACL/data/classes/voc.names | 20 +++++ .../Yolov5_for_ACL/data/classes/yymnist.names | 10 +++ 3 files changed, 110 insertions(+) create mode 100644 ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/coco.names create mode 100644 ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/voc.names create mode 100644 ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/yymnist.names diff --git a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/coco.names b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/coco.names new file mode 100644 index 000000000..ec82f0ffd --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/coco.names @@ -0,0 +1,80 @@ +person +bicycle +car +motorbike +aeroplane +bus +train +truck +boat +traffic light +fire hydrant +stop sign +parking meter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe +backpack +umbrella +handbag +tie +suitcase +frisbee +skis +snowboard +sports ball +kite +baseball bat +baseball glove +skateboard +surfboard +tennis racket +bottle +wine glass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hot dog +pizza +donut +cake +chair +sofa +potted plant +bed +dining table +toilet +tvmonitor +laptop +mouse +remote +keyboard +cell phone +microwave +oven +toaster +sink +refrigerator +book +clock +vase +scissors +teddy bear +hair drier +toothbrush diff --git a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/voc.names b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/voc.names new file mode 100644 index 000000000..1168c3999 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/voc.names @@ -0,0 +1,20 @@ +aeroplane +bicycle +bird +boat +bottle +bus +car +cat +chair +cow +diningtable +dog +horse +motorbike +person +pottedplant +sheep +sofa +train +tvmonitor \ No newline at end of file diff --git a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/yymnist.names b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/yymnist.names new file mode 100644 index 000000000..8b1acc12b --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/data/classes/yymnist.names @@ -0,0 +1,10 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 -- Gitee From 8e43827fe945d8cc2ad20912b7ab19834befb7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91cyc=E5=AE=87?= <1251519599@qq.com> Date: Thu, 5 Jan 2023 10:32:22 +0000 Subject: [PATCH 4/6] update ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/postprocess.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黑cyc宇 <1251519599@qq.com> --- .../contrib/cv/Yolov5_for_ACL/offline_inference/postprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/postprocess.py b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/postprocess.py index cd06a8663..91772dbe0 100644 --- a/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/postprocess.py +++ b/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL/offline_inference/postprocess.py @@ -92,7 +92,7 @@ class COCOevaluator: test_data, _, batch_image_id, scale, dw, dh = fetcher.process_annotations(annotations) pred_result = [] for j in range(6): - output_data = np.fromfile(inference_path + '/davinci_' + str(k).zfill(6) + '_output' + str(j) + '.bin', + output_data = np.fromfile(inference_path + '/davinci_' + str(batch_image_id).zfill(12) + '_output' + str(j) + '.bin', dtype='float32') pred_result.append(output_data) k += 1 -- Gitee From 81bb8c68a88426d508bc2fae97a34d2c5d644dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91cyc=E5=AE=87?= <1251519599@qq.com> Date: Thu, 12 Jan 2023 08:39:01 +0000 Subject: [PATCH 5/6] update ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黑cyc宇 <1251519599@qq.com> --- .../contrib/nlp/Transformer_for_ACL/README.md | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README.md b/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README.md index 00e7aaf42..fd29c31b9 100644 --- a/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README.md @@ -66,21 +66,15 @@ python3 xnlp_fmk.py \ **Pb模型转换为om模型** ```Bash -python3 xnlp_fmk.py \ - --output_dir=./save/model \ - --vocab_file=./config/translate_ende_wmt32k/vocab.translate_ende_wmt32k.32768.subwords \ - --pb_model_file=./save/model/TRANSFORMER_TRANSLATION_BatchSize_1.pb \ - --om_model_file=./save/model/TRANSFORMER_TRANSLATION_BatchSize_1.om \ - --predict_batch_size=1 \ - --soc_version="Ascend310" \ - --in_nodes="\"input:1,128\"" \ - --out_nodes="\"transformer/strided_slice_11:0\"" \ - --precision_mode="allow_mix_precision" \ - --op_select_implmode="high_precision" \ - --model_name=transformer \ - --task_name=translation \ - --action_type=atc - +atc + --framework 3 \ + --soc_version "Ascend310" \ + --model ./save/model/TRANSFORMER_TRANSLATION_BatchSize_1.pb \ + --input_shape "input:1,128" \ + --output ./save/model/TRANSFORMER_TRANSLATION_BatchSize_1 \ + --out_nodes "transformer/strided_slice_11:0" \ + --op_select_implmode "high_precision" \ + --precision_mode "allow_mix_precision" ``` **运行推理** -- Gitee From 52dd926db53cd61ef98bba4e0a50b5ba4c44312a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91cyc=E5=AE=87?= <1251519599@qq.com> Date: Thu, 12 Jan 2023 08:39:55 +0000 Subject: [PATCH 6/6] update ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README_EN.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黑cyc宇 <1251519599@qq.com> --- .../nlp/Transformer_for_ACL/README_EN.md | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README_EN.md index ee663d748..0a5e92725 100644 --- a/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README_EN.md +++ b/ACL_TensorFlow/contrib/nlp/Transformer_for_ACL/README_EN.md @@ -66,21 +66,15 @@ python3 xnlp_fmk.py \ **Convert pb to om** ```Bash -python3 xnlp_fmk.py \ - --output_dir=./save/model \ - --vocab_file=./config/translate_ende_wmt32k/vocab.translate_ende_wmt32k.32768.subwords \ - --pb_model_file=./save/model/TRANSFORMER_TRANSLATION_BatchSize_1.pb \ - --om_model_file=./save/model/TRANSFORMER_TRANSLATION_BatchSize_1.om \ - --predict_batch_size=1 \ - --soc_version="Ascend310" \ - --in_nodes="\"input:1,128\"" \ - --out_nodes="\"transformer/strided_slice_11:0\"" \ - --precision_mode="allow_mix_precision" \ - --op_select_implmode="high_precision" \ - --model_name=transformer \ - --task_name=translation \ - --action_type=atc - +atc + --framework 3 \ + --soc_version "Ascend310" \ + --model ./save/model/TRANSFORMER_TRANSLATION_BatchSize_1.pb \ + --input_shape "input:1,128" \ + --output ./save/model/TRANSFORMER_TRANSLATION_BatchSize_1 \ + --out_nodes "transformer/strided_slice_11:0" \ + --op_select_implmode "high_precision" \ + --precision_mode "allow_mix_precision" ``` **Run the inference** -- Gitee