From 9077c87480d11c3c492d5cc0b6f1bc25122b6fa7 Mon Sep 17 00:00:00 2001 From: pengaoao Date: Mon, 21 Mar 2022 21:22:33 +0800 Subject: [PATCH 1/3] fix --- ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md | 2 +- ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh | 2 +- ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/infer_perf.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md index f8734cd648..35c852947d 100644 --- a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md +++ b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md @@ -8,7 +8,7 @@ pip3.7 install -r requirements.txt ``` -2. 安装acl_infer,https://gitee.com/peng-ao/acl_infer +2. 安装acl_infer,https://gitee.com/peng-ao/pyacl 3. 获取,修改与安装开源模型代码 diff --git a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh index f46a9b5c7f..bae7e2b3a1 100644 --- a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh +++ b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh @@ -6,6 +6,6 @@ export PYTHONPATH=${install_path}/atc/python/site-packages:$PYTHONPATH export LD_LIBRARY_PATH=${install_path}/acllib/lib64:$LD_LIBRARY_PATH atc --model=encoder_revise.onnx --framework=5 --output=encoder_262_1478 --input_format=ND \ ---input_shape="input:-1,83" --log=error \ +--input_shape="input:-1,83" --log=error --optypelist_for_implmode="Sigmoid" --op_select_implmode=high_performance\ --dynamic_dims="262;326;390;454;518;582;646;710;774;838;902;966;1028;1284;1478" \ --soc_version=Ascend710 diff --git a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/infer_perf.py b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/infer_perf.py index 7e118e1b29..027cd094cb 100644 --- a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/infer_perf.py +++ b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/infer_perf.py @@ -14,7 +14,7 @@ # ============================================================================ import os import argparse -from acl_infer.acl_net import AclNet, init_acl, release_acl +from pyacl.acl_infer import AclNet, init_acl, release_acl import acl import numpy as np -- Gitee From 60934dd771facce76e7c5d385730cad83e5b4c5f Mon Sep 17 00:00:00 2001 From: pengaoao Date: Mon, 21 Mar 2022 22:16:45 +0800 Subject: [PATCH 2/3] fix --- ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md | 4 +++- ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh | 2 +- ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md index 35c852947d..b351e22c87 100644 --- a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md +++ b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/README.md @@ -45,7 +45,7 @@ pip3.7 install -r requirements.txt ``` patch -p1 < export_onnx.diff - cd espnet/egs/aishell/asr1/ + cd ./egs/aishell/asr1/ bash export_onnx.sh ``` @@ -68,6 +68,8 @@ export ASCEND_GLOBAL_LOG_LEVEL=3 2. 获取精度 + 首先修改acc.diff文件中的om模型路径(约162行)为生成的om路径 + ``` cd espnet patch -p1 < acc.diff diff --git a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh index bae7e2b3a1..3bc01ebc3a 100644 --- a/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh +++ b/ACL_PyTorch/built-in/audio/EspNet_for_Pytoch/encoder.sh @@ -6,6 +6,6 @@ export PYTHONPATH=${install_path}/atc/python/site-packages:$PYTHONPATH export LD_LIBRARY_PATH=${install_path}/acllib/lib64:$LD_LIBRARY_PATH atc --model=encoder_revise.onnx --framework=5 --output=encoder_262_1478 --input_format=ND \ ---input_shape="input:-1,83" --log=error --optypelist_for_implmode="Sigmoid" --op_select_implmode=high_performance\ +--input_shape="input:-1,83" --log=error --optypelist_for_implmode="Sigmoid" --op_select_implmode=high_performance \ --dynamic_dims="262;326;390;454;518;582;646;710;774;838;902;966;1028;1284;1478" \ --soc_version=Ascend710 diff --git a/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff b/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff index 633513671c..290efb44eb 100644 --- a/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff +++ b/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff @@ -167,7 +167,7 @@ index 73990fa..82337ca 100644 + if score > best_score: + best_score = score + best_index = i -+ return hyps[best_index][0], exe_time ++ return hyps[best_index][0], exe_time· ` · + def attention_rescoring( self, -- Gitee From 2974dd0859e0911c75cd438b2b9a892eb9f9845f Mon Sep 17 00:00:00 2001 From: pengaoao Date: Tue, 22 Mar 2022 08:53:37 +0800 Subject: [PATCH 3/3] fix getwer --- ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff b/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff index 290efb44eb..633513671c 100644 --- a/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff +++ b/ACL_PyTorch/built-in/audio/Wenet_for_Pytorch/getwer.diff @@ -167,7 +167,7 @@ index 73990fa..82337ca 100644 + if score > best_score: + best_score = score + best_index = i -+ return hyps[best_index][0], exe_time· ` · ++ return hyps[best_index][0], exe_time + def attention_rescoring( self, -- Gitee