From 80d5e86bda494d3d2e3bebf97d8f474587f92319 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 04:04:49 +0000 Subject: [PATCH 01/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md index 570bc07c2..d151afbbf 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md @@ -95,7 +95,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL ### 结果 -本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速入门指南》中的步骤操作。 #### 推理精度结果 -- Gitee From 8d3624b76241803f1e08903d8ae6d5d88d05d3fb Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 04:21:05 +0000 Subject: [PATCH 02/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../cv/2D_Attention_Unet_for_ACL/README.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md index d151afbbf..ebbb4cbba 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md @@ -61,33 +61,21 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/2D_Attention_Unet_for_ACL.zip) - For Ascend310: ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg - ``` - For Ascend310P3: - ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg + cd .. + mkdir model + atc --model=model/2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg ``` - 编译程序 - - For Ascend310: - ``` - unset ASCEND310P3_DVPP - bash build.sh - ``` - For Ascend310P3: ``` - export ASCEND310P3_DVPP=1 bash build.sh ``` - 开始运行: ``` - cd scripts bash benchmark_tf.sh ``` -- Gitee From 4f6632332213630349147582f27ed32f28790d0f Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 04:22:46 +0000 Subject: [PATCH 03/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../cv/2D_Attention_Unet_for_ACL/README_EN.md | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md index c415d205b..2c4d8b548 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md @@ -59,32 +59,18 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/2D_Attention_Unet_for_ACL.zip) - For Ascend310: - ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg - ``` - For Ascend310P3: - ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg + ``` - Build the program - For Ascend310: - ``` - unset ASCEND310P3_DVPP - bash build.sh - ``` - For Ascend310P3: ``` - export ASCEND310P3_DVPP=1 bash build.sh ``` - Run the program: ``` - cd scripts bash benchmark_tf.sh ``` -- Gitee From cc46929a047e24e27a2f5c432a7b8902bcc01abc Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 04:54:10 +0000 Subject: [PATCH 04/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md index 2c4d8b548..7da7f5a6e 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md @@ -59,7 +59,10 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/2D_Attention_Unet_for_ACL.zip) - + ``` + cd .. + mkdir model + atc --model=model/2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg ``` - Build the program -- Gitee From 4e7fe8909bbfabfe11cc4b5dc3407f2b41829027 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 04:57:47 +0000 Subject: [PATCH 05/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md index ebbb4cbba..2fdabfef8 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md @@ -83,7 +83,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL ### 结果 -本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速入门指南》中的步骤操作。 +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 #### 推理精度结果 -- Gitee From 3d7c66423990f69c50f43addab6f2d212ba7a056 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:01:13 +0000 Subject: [PATCH 06/17] update ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../built-in/cv/Densenet24_for_ACL/README_EN.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md index ea074c1d6..399cbe947 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md @@ -61,13 +61,8 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL - configure the env - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + - convert pb to om -- Gitee From 4cf29d183f6a8c96e6f11df00d1bb83cbad91bb2 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:16:03 +0000 Subject: [PATCH 07/17] update ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../built-in/cv/Densenet24_for_ACL/README.md | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md index b057dea9f..7a042d7c9 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md @@ -1,31 +1,33 @@ -# Densenet24 inference for Tensorflow +中文|[English](README_EN.md) -This repository provides a script and recipe to Inference the +# Densenet24 TensorFlow离线推理 -## Notice -**This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.** +此链接提供Densenet24 TensorFlow模型在NPU上离线推理的脚本和方法 -Before starting, please pay attention to the following adaptation conditions. If they do not match, may leading in failure. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** + +在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。 | Conditions | Need | | --- | --- | -| CANN Version | >=5.0.3 | -| Chip Platform| Ascend310 | -| 3rd Party Requirements| Please follow the 'requirements.txt' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL ``` -### 2. Download and preprocess the dataset +### 2. 下载数据集和预处理 -1. Download the dataset by yourself -2. Put the dataset files to **'Densenet24_for_ACL/ori_images'** like this: +1. 请自行下载数据集 +2. 将数据集放入 **'Densenet24_for_ACL/ori_images'**中: ``` --ori_images |----BRATS2017 @@ -47,55 +49,50 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL |----d24_correction-4.index |----d24_correction-4.meta ``` -3. Executing the Preprocessing Script +3. 执行预处理脚本 ``` cd scripts python3 preprocess.py -m ../ori_images/npu/dense24_correction-4 -mn dense24 -nc True -r ../ori_images/BRATS2017/Brats17ValidationData/ -input1 ../datasets/input_flair/ -input2 ../datasets/input_t1/ ``` -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to om.** +**离线模型转换** -- configure the env +- 环境变量设置 + + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` -- convert pb to om +- Pb模型转换为om模型 - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/DenseNet24_for_ACL.zip) + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/DenseNet24_for_ACL.zip) ``` cd .. atc --model=model/densenet24.pb --framework=3 --output=model/densenet24_1batch --soc_version=Ascend310P3 --input_shape="Placeholder:1,38,38,38,2;Placeholder_1:1,38,38,38,2" ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts bash benchmark_tf.sh ``` -## Performance +## 推理结果 -### Result +### 结果 -Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results +#### 推理精度结果 | model | **data** | TumorCore | PeritumoralEdema | EnhancingTumor | | :---------------: | :------: | :-----------: | :--------------------: | :-----------------: | -- Gitee From 4b4546793a12bfc3ea4537be98326c7352d94d87 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:20:28 +0000 Subject: [PATCH 08/17] update ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md index 7a042d7c9..b54a0ab8a 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md @@ -27,7 +27,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL ### 2. 下载数据集和预处理 1. 请自行下载数据集 -2. 将数据集放入 **'Densenet24_for_ACL/ori_images'**中: +2. 将数据集放入**'Densenet24_for_ACL/ori_images'**中: ``` --ori_images |----BRATS2017 -- Gitee From 2c5f78a4d80acbe1103e164dd4482a06f0215dfc Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:24:48 +0000 Subject: [PATCH 09/17] update ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md index b54a0ab8a..22ec74e54 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md @@ -27,7 +27,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL ### 2. 下载数据集和预处理 1. 请自行下载数据集 -2. 将数据集放入**'Densenet24_for_ACL/ori_images'**中: +2. 将数据集放入 **'Densenet24_for_ACL/ori_images'** 中: ``` --ori_images |----BRATS2017 -- Gitee From 317950f7916ff053c85688d37a68329dc01e6dd7 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:25:33 +0000 Subject: [PATCH 10/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md index 2fdabfef8..38dcbae7d 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md @@ -29,7 +29,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL 1. 请自行下载Massachusetts Roads数据集 -2. 将数据集文件放到 **'2D_Attention_Unet_for_ACL/image_ori/'** 中: +2. 将数据集文件放到 **2D_Attention_Unet_for_ACL/image_ori/** 中: ``` --image_ori |----lashan -- Gitee From f75ad6740fe1235675427b6da5c4366bbc5cf4d9 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:26:33 +0000 Subject: [PATCH 11/17] update ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md index 22ec74e54..c2d40a722 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md @@ -27,7 +27,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL ### 2. 下载数据集和预处理 1. 请自行下载数据集 -2. 将数据集放入 **'Densenet24_for_ACL/ori_images'** 中: +2. 将数据集放入 **Densenet24_for_ACL/ori_images** 中: ``` --ori_images |----BRATS2017 -- Gitee From 9e9d362ba4d748e50e92f3d27f748d2b2d275878 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:29:37 +0000 Subject: [PATCH 12/17] add ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md diff --git a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md new file mode 100644 index 000000000..e69de29bb -- Gitee From da8ce532b19180f83d85fabac38f198061c971c8 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:31:16 +0000 Subject: [PATCH 13/17] update ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../contrib/cv/3DResNet_for_ACL/README_EN.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md index e69de29bb..691a567bb 100644 --- a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md +++ b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md @@ -0,0 +1,78 @@ +English|[中文](README.md) + +# 3DResNet Inference for Tensorflow + +This repository provides a script and recipe to Inference of the 3DResNet model. + +## Notice +**This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.** + +Before starting, please pay attention to the following adaptation conditions. If they do not match, may leading in failure. + +| Conditions | Need | +| --- | --- | +| CANN Version | >=5.0.3 | +| Chip Platform| Ascend310/Ascend310P3 | +| 3rd Party Requirements| Please follow the 'requirements.txt' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL +``` + +### 2. Generate random test dataset + +1. Because of this is not a well trained model we test the model with random test dataset + +2. Generate random test dataset: +``` +cd scripts +python3 generate_random_data.py +``` +There will random testdata bin fils under *input_bins/*. + +### 3. Offline Inference + +**Convert pb to om.** + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + + +- convert pb to om + + [**pb download link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/3DResNet_for_ACL.zip) + + ``` + atc --model=3DResNet_tf_gpu.pb --framework=3 --output=3DResNet_tf_gpu --soc_version=Ascend310 --input_shape="input_1:1,64,64,32,1" --log=info + + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh + ``` + +- Run the post process: + + ``` + cd scripts + python3 post_processing.py + ``` + + +## Reference +[1] https://github.com/JihongJu/keras-resnet3d -- Gitee From 438ad26500eef4e2922169fc3e75a0c11157c525 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:39:42 +0000 Subject: [PATCH 14/17] update ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- .../contrib/cv/3DResNet_for_ACL/README.md | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md index 855e57ab5..966589639 100644 --- a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md @@ -1,77 +1,71 @@ +中文|[English](README_EN.md) +# 3DResNet Tensorflow离线推理 -# 3DResNet Inference for Tensorflow +此链接提供3DResNet Tensorflow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference of the 3DResNet model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.** - -Before starting, please pay attention to the following adaptation conditions. If they do not match, may leading in failure. +在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。 | Conditions | Need | | --- | --- | -| CANN Version | >=5.0.3 | -| Chip Platform| Ascend310/Ascend310P3 | -| 3rd Party Requirements| Please follow the 'requirements.txt' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL ``` -### 2. Generate random test dataset +### 2. 生成随机测试数据集 -1. Because of this is not a well trained model we test the model with random test dataset +1. 由于这不是一个训练好的模型,我们使用随机测试数据集测试模型 -2. Generate random test dataset: +2. 生成随机测试数据集: ``` cd scripts python3 generate_random_data.py ``` -There will random testdata bin fils under *input_bins/*. +随机数bin文件保存在 *input_bins/* 中. -### 3. Offline Inference +### 3. 离线推理 **Convert pb to om.** -- configure the env +- 环境变量设置 - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 -- convert pb to om +- Pb模型转换为om模型 - [**pb download link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/3DResNet_for_ACL.zip) + [**pb模型下载链接**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/3DResNet_for_ACL.zip) ``` atc --model=3DResNet_tf_gpu.pb --framework=3 --output=3DResNet_tf_gpu --soc_version=Ascend310 --input_shape="input_1:1,64,64,32,1" --log=info ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts bash benchmark_tf.sh ``` -- Run the post process: +- 运行后处理: ``` cd scripts @@ -79,5 +73,5 @@ There will random testdata bin fils under *input_bins/*. ``` -## Reference +## 参考 [1] https://github.com/JihongJu/keras-resnet3d -- Gitee From cbb6d430ed73167c43e4e42ccaf592ff76e41046 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:41:18 +0000 Subject: [PATCH 15/17] update ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md index 966589639..c86e83388 100644 --- a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md @@ -33,11 +33,11 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL cd scripts python3 generate_random_data.py ``` -随机数bin文件保存在 *input_bins/* 中. +随机数bin文件保存在 **input_bins/** 中. ### 3. 离线推理 -**Convert pb to om.** +**离线模型转换** - 环境变量设置 -- Gitee From 235db68063edf2ed95cb0fbad0bb1aae6c5b0991 Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:50:37 +0000 Subject: [PATCH 16/17] update ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md index 38dcbae7d..f1a5acca6 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md @@ -79,7 +79,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL bash benchmark_tf.sh ``` -## 推理结果 +## 性能 ### 结果 -- Gitee From 2f7e32ce73ed4d42c9baa96cab945f621827a77f Mon Sep 17 00:00:00 2001 From: zhangbin3777 <946766897@qq.com> Date: Wed, 19 Oct 2022 05:51:22 +0000 Subject: [PATCH 17/17] update ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md. Signed-off-by: zhangbin3777 <946766897@qq.com> --- ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md index c2d40a722..7bb823278 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md @@ -86,7 +86,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL bash benchmark_tf.sh ``` -## 推理结果 +## 性能 ### 结果 -- Gitee