1. Download the vitis_ai_runtime_r2.0.0_image_video.tar.gz package and unzip it. 下载测试即并解压
Path: /workspace/demo/VART/
wget https://www.xilinx.com/bin/public/openDownload?filename=vitis_ai_runtime_r2.0.0_image_video.tar.gz -O vitis_ai_runtime_r2.0.0_image_video.tar.gz --no-check-certificate
tar -xzvf vitis_ai_runtime_r2.0.0_image_video.tar.gz -C /workspace/demo/VART
2. Compile the sample. Take resnet50 as an example. 编译示例,用的是caffe模型中的resnet50
cd /workspace/demo/VART/resnet50
source /workspace/setup/alveo/setup.sh DPUCAHX8H #setup.sh命令,是为了生成这个IP核。不然会报错,xclbinPath is not set
bash -x build.sh #每次跑之前都记得要build
#吐槽一下,官方文档里面的-x居然是错的,-不对
3. Download the model. 下载模型
这一步与官方示例有很大不同,据作者测试,提供的model是一个错的,最终格式居然是html,根本不能用
下载地址:
Vitis-AI/model.yaml at 1.4.1 · Xilinx/Vitis-AI · GitHub
Path: /workspace/demo/VART/resnet50
wget https://www.xilinx.com/bin/public/openDownload?filename=resnet50-u50-u50lv-u280-DPUCAHX8H-r1.4.1.tar.gz
4. Untar the model on the target and install it. 解压模型并安装
先建立一个文件夹
sudo mkdir -p /usr/share/vitis_ai_library/models
然后就可以安装model的包了
tar -xzvf resnet50-u50-r2.0.0.tar.gz
sudo cp resnet50 /usr/share/vitis_ai_library/models -r
5. Run the sample 运行实例
Path: /workspace/demo/VART/resnet50
./resnet50 /usr/share/vitis_ai_library/models/resnet50/resnet50.xmodel
6. Debug记录:
由于作者的疏忽大意,一开始没有运行setup.sh,没有生成IP核,出现了以下的情况
解决方法:先运行以下setup命令
source /workspace/setup/alveo/setup.sh DPUCAHX8H
再运行下面的build命令
bash -x build.sh
然后再执行运行实例的命令就可以了
./resnet50 /usr/share/vitis_ai_library/models/resnet50/resnet50.xmodel
最终结果如下:
有个问题:不知道为什么图片显示不出来,正常应该会有个图片
参考网址:
Documentation Portal
No image while running Vitis-ai resnet50 example on Ultrascale+ ZCU102, SSH · Issue #836 · Xilinx/Vitis-AI · GitHub
Edge AI Setup on ZCU102