13 Star 61 Fork 279

Ascend/ModelZoo-TensorFlow

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

English|中文

ResNext50 Inference for Tensorflow

This repository provides a script and recipe to Inference the ResNext50 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

git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git
cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/ResNext50_for_ACL

2. Download and preprocess the dataset

  1. Download the ImageNet2012 dataset by yourself

3. Offline Inference

Convert pb to om.

  • configure the env

    Please follow the guide to set the envs

  • convert pb to om

    pb download link

    For Ascend310:

    atc --model=resnext50_tf.pb --framework=3 --output=resnext50_tf_aipp --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=resnext50_tf_aipp.cfg
    

    For Ascend310P3:

    atc --model=resnext50_tf.pb --framework=3 --output=resnext50_tf_aipp --output_type=FP32 --soc_version=Ascend310P3 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=resnext50_tf_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 --batchSize=1 --modelType=resnext50 --imgType=raw --precision=fp16 --outputType=fp32 --useDvpp=1 --deviceId=0 --modelPath=resnext50_tf_aipp.om --dataPath=image-1024 --trueValuePath=val_lable.txt
    

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 SOC data Top1/Top5
offline Inference Ascend310 50K images 77.99 %/ 93.88%
offline Inference Ascend310P3 50K images 78.3 %/ 94.2%
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ascend/ModelZoo-TensorFlow.git
git@gitee.com:ascend/ModelZoo-TensorFlow.git
ascend
ModelZoo-TensorFlow
ModelZoo-TensorFlow
master

Search