13 Star 61 Fork 279

Ascend/ModelZoo-TensorFlow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

中文|English

VAEGAN TensorFlow离线推理


此链接提供Vgg16 TensorFlow模型在NPU上离线推理的脚本和方法

VAEGAN 推理,基于 VAE/GAN


注意

此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。

在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。

Conditions Need
CANN版本 >=5.0.3
芯片平台 Ascend310/Ascend310P3
第三方依赖 请参考 'requirements.txt'

快速指南

1. 拷贝代码

git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git
cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/VAEGAN_for_ACL

2. 下载数据集和预处理

请自行下载数据集, 更多详细信息请参见: CelebA

3. 获取ckpt模型

获取ckpt模型, 更多详细信息请参见: ckpt

4. 编译程序

构建推理应用程序, 更多详细信息请参见: xacl_fmk

5. 离线推理

环境变量设置 请参考说明,设置环境变量

预处理

python3 main.py --act dump

Pb模型转换为om模型

pb模型下载链接

atc --model=./model/VAE_GAN_gpu.pb --framework=3 --output=./model/VAE_GAN_gpu --soc_version=Ascend310 --input_shape="Placeholder:64,64,64,3" --log=info

运行推理

python3 inference/xacl_inference.py

后期处理

python3 main.py --act compare

6. 演示

结果

我们通过PSNR来衡量性能。

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

搜索帮助