代码拉取完成,页面将自动刷新
中文|English
此链接提供Vgg19 TensorFlow模型在NPU上离线推理的脚本和方法
此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。
在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。
Conditions | Need |
---|---|
CANN Version | >=5.0.3 |
Chip Platform | Ascend310/Ascend310P3 |
3rd Party Requirements | Please follow the 'requirements.txt' |
git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git
cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Vgg19_for_ACL
离线模型转换
环境变量设置
请参考说明,设置环境变量
Pb模型转换为om模型
For Ascend310:
atc --model=vgg19_tf.pb --framework=3 --output=vgg19_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --insert_op_conf=vgg19_tf_aipp.cfg --enable_small_channel=1 --log=info
For Ascend310P3:
atc --model=vgg19_tf.pb --framework=3 --output=vgg19_tf_1batch --output_type=FP32 --soc_version=Ascend310P3 --input_shape="input:1,224,224,3" --insert_op_conf=vgg19_tf_aipp.cfg --enable_small_channel=1 --log=info
编译程序
For Ascend310:
unset ASCEND310P3_DVPP
bash build.sh
For Ascend310P3:
export ASCEND310P3_DVPP=1
bash build.sh
开始运行:
cd scripts
bash benchmark_tf.sh
本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。
model | data | Top1/Top5 |
---|---|---|
offline Inference | 50000 images | 71.0 %/ 89.8% |
[1] https://github.com/tensorflow/models/tree/master/research/slim
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。