13 Star 62 Fork 280

Ascend/ModelZoo-TensorFlow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.idea
ACL_TensorFlow
built-in
audio
cv
2D_Attention_Unet_for_ACL
3DUNET_for_ACL
Advanced_East_for_ACL
AlexNet_for_ACL
AlignedReID_for_ACL
CRNN_for_ACL
CTPN_for_ACL
DeepLabv3_for_ACL
DeepLabv3_plus_for_ACL
DenseNet121_for_ACL
Densenet24_for_ACL
EfficientNet_B0_for_ACL
EfficientNet_B8_for_ACL
Face_Resnet50_for_ACL
Facenet_for_ACL
GoogleNet_for_ACL
Inceptionv2_for_ACL
Inceptionv3_for_ACL
Inceptionv4_for_ACL
MobileNetv1_for_ACL
MobileNetv2_for_ACL
MobileNetv3_Large_for_ACL
OpenPose_for_ACL
PSPnet101_for_ACL
PixelLink_for_ACL
ResCNN_for_ACL
ResNext50_for_ACL
Resnet101_for_ACL
Resnet18_for_ACL
Resnet34_for_ACL
Resnet50_HC_for_ACL
Resnet50_TF_for_ACL
Resnet50v1.5_for_ACL
Resnet50v1_for_ACL
Benchmark
scripts
LICENSE
README.md
build.sh
modelzoo_level.txt
requirements.txt
resnet50v1_aipp.cfg
RetinaNet_for_ACL
SSD-Resnet34_for_ACL
SSD_Resnet50_FPN_for_ACL
ShuffleNetv1_for_ACL
ShuffleNetv2_for_ACL
Vgg16_for_ACL
Vgg19_for_ACL
Xception_for_ACL
YOLOv2_for_ACL
YOLOv3_for_ACL
YOLOv4_for_ACL
graph
nlp
recommendation
reinforcement_learning
contrib
.keep
TensorFlow
TensorFlow2
Tools/ascend_distribute
.gitignore
.gitmodules
LICENSE
NOTICE
README.CN.md
README.md
Third_Party_Open_Source_Software_Notice
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Resnet50v1 Inference for Tensorflow

This repository provides a script and recipe to Inference of the Resnet50v1.5 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/Resnet50v1_for_ACL

2. Download and preprocess the dataset

  1. Download the ImageNet2012 Validation dataset by yourself. You can get the validation pictures(50000 JPEGS and a ILSVRC2012val-label-index.txt)

  2. Put JPEGS to 'scripts/ILSVRC2012val' and label text to 'scripts/'

  3. Images Preprocess:

cd scripts
mkdir input_bins
python3 resnet50v1_preprocessing.py ./ILSVRC2012val/ ./input_bins/

The jpegs pictures will be preprocessed to bin fils.

3. Offline Inference

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
    
  • convert pb to om

    pb download link

    atc --model=resnet50v1_tf.pb --framework=3 --output=resnet50v1_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --insert_op_conf=resnet50v1_aipp.cfg --enable_small_channel=1 --log=info
    
  • Build the program

    bash build.sh
    
  • Run the program:

    cd scripts
    bash benchmark_tf.sh
    

Performance

Result

Our result was 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 Top1/Top5
offline Inference 50000 images 75.2 %/ 92.2%

Reference

[1] https://github.com/tensorflow/models/tree/master/research/slim

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ascend/ModelZoo-TensorFlow.git
git@gitee.com:ascend/ModelZoo-TensorFlow.git
ascend
ModelZoo-TensorFlow
ModelZoo-TensorFlow
master

搜索帮助