From c9d6eed9263df717dcb3f1c0df4daf3abda1e1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:04:39 +0000 Subject: [PATCH 01/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20SeqGAN=5Ffor=5FACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/.keep b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From 26857185960d09252287a8996f417fd9ed012f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:09:42 +0000 Subject: [PATCH 02/18] add ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- .../contrib/cv/SeqGAN_for_ACL/README.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md new file mode 100644 index 000000000..810ec31a7 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md @@ -0,0 +1,88 @@ +# ATC SeqGAN + + +- references: + + ["SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient"](https://arxiv.org/abs/1609.05473) + + +- training model: + + [SeqGAN_ID2096_for_TensorFlow](https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/SeqGAN_ID2096_for_TensorFlow) + + +# 1. ckpt to pb + +download **ckpt** and use **ckpt2pb.py** process ckpt to pb. + +[ckpt](https://pan.baidu.com/s/1-E3SQAxShCYcIVdkxbg19w) +Password:e3el + +# 2. pb to om +Command: +``` +atc --model=seqgan.pb --framework=3 --input_format="ND" --input_shape="Placeholder:64,20" --output=seqgan --soc_version=Ascend310 +``` +[Pb](https://pan.baidu.com/s/1YhB_1zjYb2dz_h8P_kIGUQ) +Password:m6mx + +[OM](https://pan.baidu.com/s/1mKV8wkUBz3KiF8hpxUh9mA) +Password:zdo1 + +# 3. compile msame +Reference to https://gitee.com/ascend/tools/tree/master/msame, compile **msame** + +Compile msame command: +```bash +. /home/HwHiAiUser/Ascend/ascend-toolkit/set_env.sh +export DDK_PATH=/home/HwHiAiUser/Ascend/ascend-toolkit/latest +export NPU_HOST_LIB=/home/HwHiAiUser/Ascend/ascend-toolkit/latest/runtime/lib64/stub +cd $HOME/AscendProjects/tools/msame/ +./build.sh g++ $HOME/AscendProjects/tools/msame/out + +``` + +# 4. inference +Inference command: +```bash +cd $HOME/AscendProjects/tools/msame/out +model_path=/home/HwHiAiUser/AscendProjects/SeqGAN/seqgan.om +output_path=/home/HwHiAiUser/AscendProjects/SeqGAN +./msame --model ${model_path} --output ${output_path} --outputSize 25600000 +``` + + + +Part of **Inference sys output**: +```bash +[INFO] acl init success +[INFO] open device 0 success +[INFO] create context success +[INFO] create stream success +[INFO] get run mode success +[INFO] load model ./mnasnet.om success +[INFO] create model description success +[INFO] get input dynamic gear count success +[INFO] create model output success +./output/2022113_9_31_13_612340 +[INFO] start to process file:./pic.bin +[INFO] model execute success +Inference time: 1.359ms +[INFO] get max dynamic batch size success +[INFO] output data success +Inference average time: 1.359000 ms +[INFO] destroy model input success +[INFO] unload model success, model Id is 1 +[INFO] Execute sample success +[INFO] end to destroy stream +[INFO] end to destroy context +[INFO] end to reset device is 0 +[INFO] end to finalize acl + +``` + + +Part of **Inference sys output**: +```bash +0.000629902 0.000514507 0.000611782 0.000699043 0.000445127 0.00120354 0.00102234 0.00104713 0.0011034 0.000992775 0.000550747 0.00101948 0.00100136 0.000835419 0.000398874 0.000741005 0.000406742 0.00107861 +``` -- Gitee From ec815a6360efc50b8dc9f1e06ec0553d6f8c0d86 Mon Sep 17 00:00:00 2001 From: zhang-anqi11 <956513066@qq.com> Date: Tue, 8 Nov 2022 17:13:45 +0800 Subject: [PATCH 03/18] ckpt2pb --- .../contrib/cv/SeqGAN_for_ACL/ckpt2pb.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/ckpt2pb.py new file mode 100644 index 000000000..b714d3674 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/ckpt2pb.py @@ -0,0 +1,32 @@ +import tensorflow as tf +from tensorflow.python.tools import freeze_graph +from tensorflow.python.framework import graph_util + + +def freeze_graph(input_checkpoint,output_graph): + + # 指定输出的节点名称,该节点名称必须是原模型中存在的节点 + output_node_names = "transpose_2" + saver = tf.train.import_meta_graph(input_checkpoint + '.meta', clear_devices=True) + graph = tf.get_default_graph() # 获得默认的图 + input_graph_def = graph.as_graph_def() # 返回一个序列化的图代表当前的图 + + with tf.Session() as sess: + + graph_def = tf.get_default_graph().as_graph_def(add_shapes=True) + node_list = [n.name for n in graph_def.node] + #for node in node_list: + # print("node_name", node) + saver.restore(sess, input_checkpoint) #恢复图并得到数据 + output_graph_def = graph_util.convert_variables_to_constants( # 模型持久化,将变量值固定 + sess=sess, + input_graph_def=input_graph_def,# 等于:sess.graph_def + output_node_names=output_node_names.split(","))# 如果有多个输出节点,以逗号隔开 + + with tf.gfile.GFile(output_graph, "wb") as f: #保存模型 + f.write(output_graph_def.SerializeToString()) #序列化输出 + print("%d ops in the final graph." % len(output_graph_def.node)) #得到当前图有几个操作节点 + +input_checkpoint='./checkpoint/myModel' +out_pb_path='seqgan.pb' +freeze_graph(input_checkpoint, out_pb_path) -- Gitee From ddfa76946633708138f82fbb9eb17a2829d0001e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:21:46 +0000 Subject: [PATCH 04/18] update ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- .../contrib/cv/SeqGAN_for_ACL/README.md | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md index 810ec31a7..07a7c35d1 100644 --- a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md @@ -15,19 +15,19 @@ download **ckpt** and use **ckpt2pb.py** process ckpt to pb. -[ckpt](https://pan.baidu.com/s/1-E3SQAxShCYcIVdkxbg19w) -Password:e3el +[ckpt](https://pan.baidu.com/s/1hTrdrkppaHT_onXrrTMwFg) +Password:lzqe # 2. pb to om Command: ``` atc --model=seqgan.pb --framework=3 --input_format="ND" --input_shape="Placeholder:64,20" --output=seqgan --soc_version=Ascend310 ``` -[Pb](https://pan.baidu.com/s/1YhB_1zjYb2dz_h8P_kIGUQ) -Password:m6mx +[Pb](https://pan.baidu.com/s/1zudcMVdDYCDN5q4LDrDXrg) +Password:yh6q -[OM](https://pan.baidu.com/s/1mKV8wkUBz3KiF8hpxUh9mA) -Password:zdo1 +[OM](https://pan.baidu.com/s/1HJZhBZKBX2W6i6daaMKuuw) +Password:9p09 # 3. compile msame Reference to https://gitee.com/ascend/tools/tree/master/msame, compile **msame** @@ -60,17 +60,16 @@ Part of **Inference sys output**: [INFO] create context success [INFO] create stream success [INFO] get run mode success -[INFO] load model ./mnasnet.om success +[INFO] load model ./seqgan.om success [INFO] create model description success [INFO] get input dynamic gear count success [INFO] create model output success -./output/2022113_9_31_13_612340 -[INFO] start to process file:./pic.bin +.//2022118_17_18_37_136806 [INFO] model execute success -Inference time: 1.359ms +Inference time: 181.534ms [INFO] get max dynamic batch size success [INFO] output data success -Inference average time: 1.359000 ms +Inference average time: 181.534000 ms [INFO] destroy model input success [INFO] unload model success, model Id is 1 [INFO] Execute sample success @@ -78,11 +77,5 @@ Inference average time: 1.359000 ms [INFO] end to destroy context [INFO] end to reset device is 0 [INFO] end to finalize acl - ``` - -Part of **Inference sys output**: -```bash -0.000629902 0.000514507 0.000611782 0.000699043 0.000445127 0.00120354 0.00102234 0.00104713 0.0011034 0.000992775 0.000550747 0.00101948 0.00100136 0.000835419 0.000398874 0.000741005 0.000406742 0.00107861 -``` -- Gitee From 5965a031eeca09e25aeaa7681ffdb8a13495e0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:29:25 +0000 Subject: [PATCH 05/18] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20Fpointnet=5Ffor=5FAC?= =?UTF-8?q?L?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/.keep b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From d81b3b8d4c9589b76141f178b2e8301881f78b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:38:41 +0000 Subject: [PATCH 06/18] add ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- .../contrib/cv/Fpointnet_for_ACL/README.md. | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. new file mode 100644 index 000000000..37ff74e47 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. @@ -0,0 +1,80 @@ +# ATC Fpointnet + + +- references: + + ["Frustum PointNets for 3D Object Detection from RGB-D Data"](https://arxiv.org/pdf/1711.08488.pdf) + + +- training model: + + [Fpointnet_ID1470_for_TensorfFow](https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/Fpointnet_ID1470_for_TensorfFow) + + +# 1. ckpt to pb + +download **ckpt** and use **ckpt2pb.py** process ckpt to pb. + +[ckpt](https://pan.baidu.com/s/1U7qJ4cYOokd8cRAmeezxHg) +Password:ms1m + +# 2. pb to om +Command: +``` +atc --input_shape="Placeholder:32,1024,4;Placeholder_1:32,3;Placeholder_3:32,3;Placeholder_9:32,512,2" --input_format=ND --output="fpointnet" --soc_version=Ascend310 --framework=3 --model="./fpointnet.pb" --log=info +``` +[Pb](https://pan.baidu.com/s/1UzZkdb_1rkEOdNwWx50JFw) +Password:z8ml + +[OM](https://pan.baidu.com/s/1Q-GDPUCVJ6-ZyuC7Xp_QEw) +Password:zzls + +# 3. compile msame +Reference to https://gitee.com/ascend/tools/tree/master/msame, compile **msame** + +Compile msame command: +```bash +. /home/HwHiAiUser/Ascend/ascend-toolkit/set_env.sh +export DDK_PATH=/home/HwHiAiUser/Ascend/ascend-toolkit/latest +export NPU_HOST_LIB=/home/HwHiAiUser/Ascend/ascend-toolkit/latest/runtime/lib64/stub +cd $HOME/AscendProjects/tools/msame/ +./build.sh g++ $HOME/AscendProjects/tools/msame/out + +``` + +# 4. inference +Inference command: +```bash +cd $HOME/AscendProjects/tools/msame/out +model_path=/home/HwHiAiUser/AscendProjects/Fpointnet/fpointnet.om +output_path=/home/HwHiAiUser/AscendProjects/Fpointnet +./msame --model ${model_path} --output ${output_path} +``` + + + +Part of **Inference sys output**: +```bash +[INFO] acl init success +[INFO] create context success +[INFO] create stream success +[INFO] get run mode success +[INFO] load model ./fpointnet.om success +[INFO] create model description success +[INFO] get input dynamic gear count success +[INFO] create model output success +.//2022117_16_37_5_559775 +[INFO] model execute success +Inference time: 29.151ms +[INFO] get max dynamic batch size success +[INFO] output data success +Inference average time: 29.151000 ms +[INFO] destroy model input success +[INFO] unload model success, model Id is 1 +[INFO] Execute sample success +[INFO] end to destroy stream +[INFO] end to destroy context +[INFO] end to reset device is 0 +[INFO] end to finalize acl +``` + -- Gitee From e98356617a0c2a9d19170d76e9bb6aa5f8b7c7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:39:48 +0000 Subject: [PATCH 07/18] add ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md new file mode 100644 index 000000000..99a809136 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md @@ -0,0 +1,2 @@ + + -- Gitee From 087719854b103c1ee168d98665ad0bfd3f281182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:40:29 +0000 Subject: [PATCH 08/18] update ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- .../contrib/cv/Fpointnet_for_ACL/README.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md index 99a809136..14714e64f 100644 --- a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md @@ -1,2 +1,82 @@ + # ATC Fpointnet + + +- references: + + ["Frustum PointNets for 3D Object Detection from RGB-D Data"](https://arxiv.org/pdf/1711.08488.pdf) + + +- training model: + + [Fpointnet_ID1470_for_TensorfFow](https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/Fpointnet_ID1470_for_TensorfFow) + + +# 1. ckpt to pb + +download **ckpt** and use **ckpt2pb.py** process ckpt to pb. + +[ckpt](https://pan.baidu.com/s/1U7qJ4cYOokd8cRAmeezxHg) +Password:ms1m + +# 2. pb to om +Command: +``` +atc --input_shape="Placeholder:32,1024,4;Placeholder_1:32,3;Placeholder_3:32,3;Placeholder_9:32,512,2" --input_format=ND --output="fpointnet" --soc_version=Ascend310 --framework=3 --model="./fpointnet.pb" --log=info +``` +[Pb](https://pan.baidu.com/s/1UzZkdb_1rkEOdNwWx50JFw) +Password:z8ml + +[OM](https://pan.baidu.com/s/1Q-GDPUCVJ6-ZyuC7Xp_QEw) +Password:zzls + +# 3. compile msame +Reference to https://gitee.com/ascend/tools/tree/master/msame, compile **msame** + +Compile msame command: +```bash +. /home/HwHiAiUser/Ascend/ascend-toolkit/set_env.sh +export DDK_PATH=/home/HwHiAiUser/Ascend/ascend-toolkit/latest +export NPU_HOST_LIB=/home/HwHiAiUser/Ascend/ascend-toolkit/latest/runtime/lib64/stub +cd $HOME/AscendProjects/tools/msame/ +./build.sh g++ $HOME/AscendProjects/tools/msame/out + +``` + +# 4. inference +Inference command: +```bash +cd $HOME/AscendProjects/tools/msame/out +model_path=/home/HwHiAiUser/AscendProjects/Fpointnet/fpointnet.om +output_path=/home/HwHiAiUser/AscendProjects/Fpointnet +./msame --model ${model_path} --output ${output_path} +``` + + + +Part of **Inference sys output**: +```bash +[INFO] acl init success +[INFO] create context success +[INFO] create stream success +[INFO] get run mode success +[INFO] load model ./fpointnet.om success +[INFO] create model description success +[INFO] get input dynamic gear count success +[INFO] create model output success +.//2022117_16_37_5_559775 +[INFO] model execute success +Inference time: 29.151ms +[INFO] get max dynamic batch size success +[INFO] output data success +Inference average time: 29.151000 ms +[INFO] destroy model input success +[INFO] unload model success, model Id is 1 +[INFO] Execute sample success +[INFO] end to destroy stream +[INFO] end to destroy context +[INFO] end to reset device is 0 +[INFO] end to finalize acl +``` + -- Gitee From 295c4af81c7aedf64c996362a178c52b165ea910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:40:43 +0000 Subject: [PATCH 09/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20AC?= =?UTF-8?q?L=5FTensorFlow/contrib/cv/Fpointnet=5Ffor=5FACL/README.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contrib/cv/Fpointnet_for_ACL/README.md. | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. deleted file mode 100644 index 37ff74e47..000000000 --- a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. +++ /dev/null @@ -1,80 +0,0 @@ -# ATC Fpointnet - - -- references: - - ["Frustum PointNets for 3D Object Detection from RGB-D Data"](https://arxiv.org/pdf/1711.08488.pdf) - - -- training model: - - [Fpointnet_ID1470_for_TensorfFow](https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/Fpointnet_ID1470_for_TensorfFow) - - -# 1. ckpt to pb - -download **ckpt** and use **ckpt2pb.py** process ckpt to pb. - -[ckpt](https://pan.baidu.com/s/1U7qJ4cYOokd8cRAmeezxHg) -Password:ms1m - -# 2. pb to om -Command: -``` -atc --input_shape="Placeholder:32,1024,4;Placeholder_1:32,3;Placeholder_3:32,3;Placeholder_9:32,512,2" --input_format=ND --output="fpointnet" --soc_version=Ascend310 --framework=3 --model="./fpointnet.pb" --log=info -``` -[Pb](https://pan.baidu.com/s/1UzZkdb_1rkEOdNwWx50JFw) -Password:z8ml - -[OM](https://pan.baidu.com/s/1Q-GDPUCVJ6-ZyuC7Xp_QEw) -Password:zzls - -# 3. compile msame -Reference to https://gitee.com/ascend/tools/tree/master/msame, compile **msame** - -Compile msame command: -```bash -. /home/HwHiAiUser/Ascend/ascend-toolkit/set_env.sh -export DDK_PATH=/home/HwHiAiUser/Ascend/ascend-toolkit/latest -export NPU_HOST_LIB=/home/HwHiAiUser/Ascend/ascend-toolkit/latest/runtime/lib64/stub -cd $HOME/AscendProjects/tools/msame/ -./build.sh g++ $HOME/AscendProjects/tools/msame/out - -``` - -# 4. inference -Inference command: -```bash -cd $HOME/AscendProjects/tools/msame/out -model_path=/home/HwHiAiUser/AscendProjects/Fpointnet/fpointnet.om -output_path=/home/HwHiAiUser/AscendProjects/Fpointnet -./msame --model ${model_path} --output ${output_path} -``` - - - -Part of **Inference sys output**: -```bash -[INFO] acl init success -[INFO] create context success -[INFO] create stream success -[INFO] get run mode success -[INFO] load model ./fpointnet.om success -[INFO] create model description success -[INFO] get input dynamic gear count success -[INFO] create model output success -.//2022117_16_37_5_559775 -[INFO] model execute success -Inference time: 29.151ms -[INFO] get max dynamic batch size success -[INFO] output data success -Inference average time: 29.151000 ms -[INFO] destroy model input success -[INFO] unload model success, model Id is 1 -[INFO] Execute sample success -[INFO] end to destroy stream -[INFO] end to destroy context -[INFO] end to reset device is 0 -[INFO] end to finalize acl -``` - -- Gitee From 14f8b07befbcd0ca56a8f3b7d6ebcc2f05f7373b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:45:45 +0000 Subject: [PATCH 10/18] add ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- .../contrib/cv/Fpointnet_for_ACL/ckpt2pb.py | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py new file mode 100644 index 000000000..cb9e16699 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py @@ -0,0 +1,58 @@ +import tensorflow as tf +from tensorflow.python.framework import graph_util +from tensorflow.core.protobuf.rewriter_config_pb2 import RewriterConfig + +tf.compat.v1.disable_eager_execution() + +def freeze_graph(input_checkpoint,output_graph): + + # 指定输出的节点名称,该节点名称必须是原模型中存在的节点 + output_node_names = "Squeeze_1,add_2" + saver = tf.train.import_meta_graph(input_checkpoint + '.meta', clear_devices=True) + + with tf.Session() as sess: + saver.restore(sess, input_checkpoint) #恢复图并得到数据 + graph_def = tf.get_default_graph().as_graph_def(add_shapes=True) + node_list = [n.name for n in graph_def.node] + for node in node_list: + print("node_name", node) + + for node in graph_def.node: + if node.op == 'Placeholder' and node.name == 'Placeholder_8': + print(node) + node.op = 'Const' + node.attr["value"].CopyFrom(tf.AttrValue(tensor=tf.make_tensor_proto(False, tf.bool))) + del node.attr['shape'] + + if node.op == 'PyFunc' and node.name == 'PyFunc': + print(node) + node.op = 'Placeholder' + node.name = 'Placeholder_9' + shape = tf.TensorShape([32,None,2]) + node.attr["shape"].CopyFrom(tf.AttrValue(shape=shape.as_proto())) + dtype = tf.dtypes.as_dtype("int32") + node.attr["dtype"].CopyFrom(tf.AttrValue(type=dtype.as_datatype_enum)) + node.input.remove('Squeeze_1') + del node.attr['Tin'] + del node.attr['Tout'] + del node.attr['token'] + del node.attr['_output_shapes'] + print(node) + + if node.op == 'GatherNd' and node.name == 'GatherNd': + node.input.remove('PyFunc') + node.input.append('Placeholder_9') + print(node) + + output_graph_def = graph_util.convert_variables_to_constants( # 模型持久化,将变量值固定 + sess=sess, + input_graph_def=graph_def,# 等于:sess.graph_def + output_node_names=output_node_names.split(","))# 如果有多个输出节点,以逗号隔开 + + with tf.gfile.GFile(output_graph, "wb") as f: #保存模型 + f.write(output_graph_def.SerializeToString()) #序列化输出 + print("%d ops in the final graph." % len(output_graph_def.node)) #得到当前图有几个操作节点 + +input_checkpoint='./model.ckpt' +out_pb_path='fpointnet.pb' +freeze_graph(input_checkpoint, out_pb_path) -- Gitee From 6f785ccaaf9d0c6930e28c68b51a7bd6e84d7cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:52:10 +0000 Subject: [PATCH 11/18] update ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张安琪 <956513066@qq.com> --- ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md index 14714e64f..d23f87af6 100644 --- a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md @@ -56,6 +56,7 @@ output_path=/home/HwHiAiUser/AscendProjects/Fpointnet Part of **Inference sys output**: ```bash [INFO] acl init success +[INFO] open device 0 success [INFO] create context success [INFO] create stream success [INFO] get run mode success -- Gitee From 71ce2dadea9f077ebb598c0c3bded762841c6a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:53:06 +0000 Subject: [PATCH 12/18] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20ACL=5FTenso?= =?UTF-8?q?rFlow/contrib/cv/mnasnet=20=E4=B8=BA=20ACL=5FTensorFlow/contrib?= =?UTF-8?q?/cv/MnasNet=5Ffor=20ACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contrib/cv/{mnasnet => MnasNet_for ACL}/.keep | 0 .../cv/{mnasnet => MnasNet_for ACL}/README.md | 0 .../cv/{mnasnet => MnasNet_for ACL}/ckpt2pb.py | 0 .../contrib/cv/{mnasnet => MnasNet_for ACL}/pic.bin | Bin 4 files changed, 0 insertions(+), 0 deletions(-) rename ACL_TensorFlow/contrib/cv/{mnasnet => MnasNet_for ACL}/.keep (100%) rename ACL_TensorFlow/contrib/cv/{mnasnet => MnasNet_for ACL}/README.md (100%) rename ACL_TensorFlow/contrib/cv/{mnasnet => MnasNet_for ACL}/ckpt2pb.py (100%) rename ACL_TensorFlow/contrib/cv/{mnasnet => MnasNet_for ACL}/pic.bin (100%) diff --git a/ACL_TensorFlow/contrib/cv/mnasnet/.keep b/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/.keep similarity index 100% rename from ACL_TensorFlow/contrib/cv/mnasnet/.keep rename to ACL_TensorFlow/contrib/cv/MnasNet_for ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/mnasnet/README.md b/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/README.md similarity index 100% rename from ACL_TensorFlow/contrib/cv/mnasnet/README.md rename to ACL_TensorFlow/contrib/cv/MnasNet_for ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/mnasnet/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/ckpt2pb.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/mnasnet/ckpt2pb.py rename to ACL_TensorFlow/contrib/cv/MnasNet_for ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/mnasnet/pic.bin b/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/pic.bin similarity index 100% rename from ACL_TensorFlow/contrib/cv/mnasnet/pic.bin rename to ACL_TensorFlow/contrib/cv/MnasNet_for ACL/pic.bin -- Gitee From 695bd940427ecbc7a6b7c99aced4771f25328e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Tue, 8 Nov 2022 09:53:53 +0000 Subject: [PATCH 13/18] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20ACL=5FTenso?= =?UTF-8?q?rFlow/contrib/cv/edsr=20=E4=B8=BA=20ACL=5FTensorFlow/contrib/cv?= =?UTF-8?q?/EDSR=5Ffor=5FACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contrib/cv/{edsr => EDSR_for_ACL}/.keep | 0 .../contrib/cv/{edsr => EDSR_for_ACL}/README.md | 0 .../contrib/cv/{edsr => EDSR_for_ACL}/ckpt2pb.py | 0 .../contrib/cv/{edsr => EDSR_for_ACL}/edsr.py | 0 .../contrib/cv/{edsr => EDSR_for_ACL}/run.py | 0 .../contrib/cv/{edsr => EDSR_for_ACL}/testpic.bin | Bin 6 files changed, 0 insertions(+), 0 deletions(-) rename ACL_TensorFlow/contrib/cv/{edsr => EDSR_for_ACL}/.keep (100%) rename ACL_TensorFlow/contrib/cv/{edsr => EDSR_for_ACL}/README.md (100%) rename ACL_TensorFlow/contrib/cv/{edsr => EDSR_for_ACL}/ckpt2pb.py (100%) rename ACL_TensorFlow/contrib/cv/{edsr => EDSR_for_ACL}/edsr.py (100%) rename ACL_TensorFlow/contrib/cv/{edsr => EDSR_for_ACL}/run.py (100%) rename ACL_TensorFlow/contrib/cv/{edsr => EDSR_for_ACL}/testpic.bin (100%) diff --git a/ACL_TensorFlow/contrib/cv/edsr/.keep b/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/.keep similarity index 100% rename from ACL_TensorFlow/contrib/cv/edsr/.keep rename to ACL_TensorFlow/contrib/cv/EDSR_for_ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/edsr/README.md b/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/README.md similarity index 100% rename from ACL_TensorFlow/contrib/cv/edsr/README.md rename to ACL_TensorFlow/contrib/cv/EDSR_for_ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/edsr/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/ckpt2pb.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/edsr/ckpt2pb.py rename to ACL_TensorFlow/contrib/cv/EDSR_for_ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/edsr/edsr.py b/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/edsr.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/edsr/edsr.py rename to ACL_TensorFlow/contrib/cv/EDSR_for_ACL/edsr.py diff --git a/ACL_TensorFlow/contrib/cv/edsr/run.py b/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/run.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/edsr/run.py rename to ACL_TensorFlow/contrib/cv/EDSR_for_ACL/run.py diff --git a/ACL_TensorFlow/contrib/cv/edsr/testpic.bin b/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/testpic.bin similarity index 100% rename from ACL_TensorFlow/contrib/cv/edsr/testpic.bin rename to ACL_TensorFlow/contrib/cv/EDSR_for_ACL/testpic.bin -- Gitee From 7e85b5b36e1df1e0ca38b8d76cf4bae2825bf596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Mon, 14 Nov 2022 08:18:19 +0000 Subject: [PATCH 14/18] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20ACL=5FTenso?= =?UTF-8?q?rFlow/contrib/cv/EDSR=5Ffor=5FACL=20=E4=B8=BA=20ACL=5FTensorFlo?= =?UTF-8?q?w/contrib/cv/EDSR=5FID1263=5Ffor=5FACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/.keep | 0 .../{EDSR_for_ACL => EDSR_ID1263_for_ACL}/README.md | 0 .../ckpt2pb.py | 0 .../{EDSR_for_ACL => EDSR_ID1263_for_ACL}/edsr.py | 0 .../cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/run.py | 0 .../testpic.bin | Bin 6 files changed, 0 insertions(+), 0 deletions(-) rename ACL_TensorFlow/contrib/cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/.keep (100%) rename ACL_TensorFlow/contrib/cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/README.md (100%) rename ACL_TensorFlow/contrib/cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/ckpt2pb.py (100%) rename ACL_TensorFlow/contrib/cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/edsr.py (100%) rename ACL_TensorFlow/contrib/cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/run.py (100%) rename ACL_TensorFlow/contrib/cv/{EDSR_for_ACL => EDSR_ID1263_for_ACL}/testpic.bin (100%) diff --git a/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/.keep b/ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/.keep similarity index 100% rename from ACL_TensorFlow/contrib/cv/EDSR_for_ACL/.keep rename to ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/README.md similarity index 100% rename from ACL_TensorFlow/contrib/cv/EDSR_for_ACL/README.md rename to ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/ckpt2pb.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/EDSR_for_ACL/ckpt2pb.py rename to ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/edsr.py b/ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/edsr.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/EDSR_for_ACL/edsr.py rename to ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/edsr.py diff --git a/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/run.py b/ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/run.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/EDSR_for_ACL/run.py rename to ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/run.py diff --git a/ACL_TensorFlow/contrib/cv/EDSR_for_ACL/testpic.bin b/ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/testpic.bin similarity index 100% rename from ACL_TensorFlow/contrib/cv/EDSR_for_ACL/testpic.bin rename to ACL_TensorFlow/contrib/cv/EDSR_ID1263_for_ACL/testpic.bin -- Gitee From 9e298912fbd5a3a6185ac88ec33a80c33ecfd09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Mon, 14 Nov 2022 08:18:56 +0000 Subject: [PATCH 15/18] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20ACL=5FTenso?= =?UTF-8?q?rFlow/contrib/cv/MnasNet=5Ffor=20ACL=20=E4=B8=BA=20ACL=5FTensor?= =?UTF-8?q?Flow/contrib/cv/MnasNet=5FID0728=5Ffor=20ACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep | 0 .../README.md | 0 .../ckpt2pb.py | 0 .../pic.bin | Bin 4 files changed, 0 insertions(+), 0 deletions(-) rename ACL_TensorFlow/contrib/cv/{MnasNet_for ACL => MnasNet_ID0728_for ACL}/.keep (100%) rename ACL_TensorFlow/contrib/cv/{MnasNet_for ACL => MnasNet_ID0728_for ACL}/README.md (100%) rename ACL_TensorFlow/contrib/cv/{MnasNet_for ACL => MnasNet_ID0728_for ACL}/ckpt2pb.py (100%) rename ACL_TensorFlow/contrib/cv/{MnasNet_for ACL => MnasNet_ID0728_for ACL}/pic.bin (100%) diff --git a/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/.keep b/ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/.keep similarity index 100% rename from ACL_TensorFlow/contrib/cv/MnasNet_for ACL/.keep rename to ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/README.md b/ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/README.md similarity index 100% rename from ACL_TensorFlow/contrib/cv/MnasNet_for ACL/README.md rename to ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/ckpt2pb.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/MnasNet_for ACL/ckpt2pb.py rename to ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/MnasNet_for ACL/pic.bin b/ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/pic.bin similarity index 100% rename from ACL_TensorFlow/contrib/cv/MnasNet_for ACL/pic.bin rename to ACL_TensorFlow/contrib/cv/MnasNet_ID0728_for ACL/pic.bin -- Gitee From d9d684da5a414c0d4849c481a73ae68650125559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Mon, 14 Nov 2022 08:19:23 +0000 Subject: [PATCH 16/18] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20ACL=5FTenso?= =?UTF-8?q?rFlow/contrib/cv/Fpointnet=5Ffor=5FACL=20=E4=B8=BA=20ACL=5FTens?= =?UTF-8?q?orFlow/contrib/cv/Fpointnet=5FID1470for=5FACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cv/{Fpointnet_for_ACL => Fpointnet_ID1470for_ACL}/.keep | 0 .../cv/{Fpointnet_for_ACL => Fpointnet_ID1470for_ACL}/README.md | 0 .../cv/{Fpointnet_for_ACL => Fpointnet_ID1470for_ACL}/ckpt2pb.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename ACL_TensorFlow/contrib/cv/{Fpointnet_for_ACL => Fpointnet_ID1470for_ACL}/.keep (100%) rename ACL_TensorFlow/contrib/cv/{Fpointnet_for_ACL => Fpointnet_ID1470for_ACL}/README.md (100%) rename ACL_TensorFlow/contrib/cv/{Fpointnet_for_ACL => Fpointnet_ID1470for_ACL}/ckpt2pb.py (100%) diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/.keep b/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/.keep similarity index 100% rename from ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/.keep rename to ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/README.md similarity index 100% rename from ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/README.md rename to ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/ckpt2pb.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/Fpointnet_for_ACL/ckpt2pb.py rename to ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/ckpt2pb.py -- Gitee From 7b39302e918e2a8fc5b4092c5b73a1bdc6559d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Mon, 14 Nov 2022 08:20:03 +0000 Subject: [PATCH 17/18] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20ACL=5FTenso?= =?UTF-8?q?rFlow/contrib/cv/SeqGAN=5Ffor=5FACL=20=E4=B8=BA=20ACL=5FTensorF?= =?UTF-8?q?low/contrib/cv/SeqGAN=5FID2096=5Ffor=5FACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contrib/cv/{SeqGAN_for_ACL => SeqGAN_ID2096_for_ACL}/.keep | 0 .../cv/{SeqGAN_for_ACL => SeqGAN_ID2096_for_ACL}/README.md | 0 .../cv/{SeqGAN_for_ACL => SeqGAN_ID2096_for_ACL}/ckpt2pb.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename ACL_TensorFlow/contrib/cv/{SeqGAN_for_ACL => SeqGAN_ID2096_for_ACL}/.keep (100%) rename ACL_TensorFlow/contrib/cv/{SeqGAN_for_ACL => SeqGAN_ID2096_for_ACL}/README.md (100%) rename ACL_TensorFlow/contrib/cv/{SeqGAN_for_ACL => SeqGAN_ID2096_for_ACL}/ckpt2pb.py (100%) diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/.keep b/ACL_TensorFlow/contrib/cv/SeqGAN_ID2096_for_ACL/.keep similarity index 100% rename from ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/.keep rename to ACL_TensorFlow/contrib/cv/SeqGAN_ID2096_for_ACL/.keep diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/SeqGAN_ID2096_for_ACL/README.md similarity index 100% rename from ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/README.md rename to ACL_TensorFlow/contrib/cv/SeqGAN_ID2096_for_ACL/README.md diff --git a/ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/SeqGAN_ID2096_for_ACL/ckpt2pb.py similarity index 100% rename from ACL_TensorFlow/contrib/cv/SeqGAN_for_ACL/ckpt2pb.py rename to ACL_TensorFlow/contrib/cv/SeqGAN_ID2096_for_ACL/ckpt2pb.py -- Gitee From 2e78ca2255ec6c211cfb609692dd2f8a2b507575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=AE=89=E7=90=AA?= <956513066@qq.com> Date: Fri, 18 Nov 2022 02:46:08 +0000 Subject: [PATCH 18/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20AC?= =?UTF-8?q?L=5FTensorFlow/contrib/cv/Fpointnet=5FID1470for=5FACL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contrib/cv/Fpointnet_ID1470for_ACL/.keep | 0 .../cv/Fpointnet_ID1470for_ACL/README.md | 83 ------------------- .../cv/Fpointnet_ID1470for_ACL/ckpt2pb.py | 58 ------------- 3 files changed, 141 deletions(-) delete mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/.keep delete mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/README.md delete mode 100644 ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/ckpt2pb.py diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/.keep b/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/README.md b/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/README.md deleted file mode 100644 index d23f87af6..000000000 --- a/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/README.md +++ /dev/null @@ -1,83 +0,0 @@ - # ATC Fpointnet - - -- references: - - ["Frustum PointNets for 3D Object Detection from RGB-D Data"](https://arxiv.org/pdf/1711.08488.pdf) - - -- training model: - - [Fpointnet_ID1470_for_TensorfFow](https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/Fpointnet_ID1470_for_TensorfFow) - - -# 1. ckpt to pb - -download **ckpt** and use **ckpt2pb.py** process ckpt to pb. - -[ckpt](https://pan.baidu.com/s/1U7qJ4cYOokd8cRAmeezxHg) -Password:ms1m - -# 2. pb to om -Command: -``` -atc --input_shape="Placeholder:32,1024,4;Placeholder_1:32,3;Placeholder_3:32,3;Placeholder_9:32,512,2" --input_format=ND --output="fpointnet" --soc_version=Ascend310 --framework=3 --model="./fpointnet.pb" --log=info -``` -[Pb](https://pan.baidu.com/s/1UzZkdb_1rkEOdNwWx50JFw) -Password:z8ml - -[OM](https://pan.baidu.com/s/1Q-GDPUCVJ6-ZyuC7Xp_QEw) -Password:zzls - -# 3. compile msame -Reference to https://gitee.com/ascend/tools/tree/master/msame, compile **msame** - -Compile msame command: -```bash -. /home/HwHiAiUser/Ascend/ascend-toolkit/set_env.sh -export DDK_PATH=/home/HwHiAiUser/Ascend/ascend-toolkit/latest -export NPU_HOST_LIB=/home/HwHiAiUser/Ascend/ascend-toolkit/latest/runtime/lib64/stub -cd $HOME/AscendProjects/tools/msame/ -./build.sh g++ $HOME/AscendProjects/tools/msame/out - -``` - -# 4. inference -Inference command: -```bash -cd $HOME/AscendProjects/tools/msame/out -model_path=/home/HwHiAiUser/AscendProjects/Fpointnet/fpointnet.om -output_path=/home/HwHiAiUser/AscendProjects/Fpointnet -./msame --model ${model_path} --output ${output_path} -``` - - - -Part of **Inference sys output**: -```bash -[INFO] acl init success -[INFO] open device 0 success -[INFO] create context success -[INFO] create stream success -[INFO] get run mode success -[INFO] load model ./fpointnet.om success -[INFO] create model description success -[INFO] get input dynamic gear count success -[INFO] create model output success -.//2022117_16_37_5_559775 -[INFO] model execute success -Inference time: 29.151ms -[INFO] get max dynamic batch size success -[INFO] output data success -Inference average time: 29.151000 ms -[INFO] destroy model input success -[INFO] unload model success, model Id is 1 -[INFO] Execute sample success -[INFO] end to destroy stream -[INFO] end to destroy context -[INFO] end to reset device is 0 -[INFO] end to finalize acl -``` - - - diff --git a/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/ckpt2pb.py b/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/ckpt2pb.py deleted file mode 100644 index cb9e16699..000000000 --- a/ACL_TensorFlow/contrib/cv/Fpointnet_ID1470for_ACL/ckpt2pb.py +++ /dev/null @@ -1,58 +0,0 @@ -import tensorflow as tf -from tensorflow.python.framework import graph_util -from tensorflow.core.protobuf.rewriter_config_pb2 import RewriterConfig - -tf.compat.v1.disable_eager_execution() - -def freeze_graph(input_checkpoint,output_graph): - - # 指定输出的节点名称,该节点名称必须是原模型中存在的节点 - output_node_names = "Squeeze_1,add_2" - saver = tf.train.import_meta_graph(input_checkpoint + '.meta', clear_devices=True) - - with tf.Session() as sess: - saver.restore(sess, input_checkpoint) #恢复图并得到数据 - graph_def = tf.get_default_graph().as_graph_def(add_shapes=True) - node_list = [n.name for n in graph_def.node] - for node in node_list: - print("node_name", node) - - for node in graph_def.node: - if node.op == 'Placeholder' and node.name == 'Placeholder_8': - print(node) - node.op = 'Const' - node.attr["value"].CopyFrom(tf.AttrValue(tensor=tf.make_tensor_proto(False, tf.bool))) - del node.attr['shape'] - - if node.op == 'PyFunc' and node.name == 'PyFunc': - print(node) - node.op = 'Placeholder' - node.name = 'Placeholder_9' - shape = tf.TensorShape([32,None,2]) - node.attr["shape"].CopyFrom(tf.AttrValue(shape=shape.as_proto())) - dtype = tf.dtypes.as_dtype("int32") - node.attr["dtype"].CopyFrom(tf.AttrValue(type=dtype.as_datatype_enum)) - node.input.remove('Squeeze_1') - del node.attr['Tin'] - del node.attr['Tout'] - del node.attr['token'] - del node.attr['_output_shapes'] - print(node) - - if node.op == 'GatherNd' and node.name == 'GatherNd': - node.input.remove('PyFunc') - node.input.append('Placeholder_9') - print(node) - - output_graph_def = graph_util.convert_variables_to_constants( # 模型持久化,将变量值固定 - sess=sess, - input_graph_def=graph_def,# 等于:sess.graph_def - output_node_names=output_node_names.split(","))# 如果有多个输出节点,以逗号隔开 - - with tf.gfile.GFile(output_graph, "wb") as f: #保存模型 - f.write(output_graph_def.SerializeToString()) #序列化输出 - print("%d ops in the final graph." % len(output_graph_def.node)) #得到当前图有几个操作节点 - -input_checkpoint='./model.ckpt' -out_pb_path='fpointnet.pb' -freeze_graph(input_checkpoint, out_pb_path) -- Gitee