Xilinx / Vitis-AI

Vitis AI is Xilinx’s development stack for AI inference on Xilinx hardware platforms, including both edge devices and Alveo cards.
https://www.xilinx.com/ai
Apache License 2.0
1.49k stars 633 forks source link

[VAI 1.3] Compilation failed for cf_resnet50_imagenet_224_224_7.7G_1.3 #258

Closed hill19850213 closed 3 years ago

hill19850213 commented 3 years ago

Hi,

I have downloaded the cf_resnet50_imagenet_224_224_7.7G_1.3 and have tried to compile it. There was an error occurred during compilation.


Here is my script:

!/bin/sh

TARGET=ZCU102 NET_NAME=resnet50 DEPLOY_MODEL_PATH=vai_q_output CF_NETWORK_PATH=./cf_resnet50_imagenet_224_224_7.7G_1.3

ARCH=./arch.json

vai_c_caffe --prototxt ${CF_NETWORK_PATH}/quantized/deploy.prototxt \ --caffemodel ${CF_NETWORK_PATH}/quantized/deploy.caffemodel \ --arch ${ARCH} \ --output_dir ${CF_NETWORK_PATH}/vai_coutput${TARGET}/ \ --net_name ${NET_NAME} \ --options "{'save_kernel':''}"

How to fix it?

Sitting

qianglin-xlnx commented 3 years ago

Hi @hill19850213 Could you check if you have download the latest cf_resnet50_imagenet_224_224_7.7G_1.3.zip package, we have updated it last week. The md5 of cf_resnet50_imagenet_224_224_7.7G_1.3.zip package is: 4ef5c8c680a52dc22252a9d82417d0bb cf_resnet50_imagenet_224_224_7.7G_1.3.zip When I use the script to compile the model, it shows normal, as shown below.

(vitis-ai-caffe) Vitis-AI /workspace/model_test > cat compiler.sh

!/bin/sh

TARGET=ZCU102 NET_NAME=resnet50 DEPLOY_MODEL_PATH=vai_q_output CF_NETWORK_PATH=./cf_resnet50_imagenet_224_224_7.7G_1.3

ARCH=/opt/vitis_ai/compiler/arch/DPUCZDX8G/ZCU102/arch.json

vai_c_caffe --prototxt ${CF_NETWORK_PATH}/quantized/deploy.prototxt \ --caffemodel ${CF_NETWORK_PATH}/quantized/deploy.caffemodel \ --arch ${ARCH} \ --output_dir ${CF_NETWORK_PATH}/vai_coutput${TARGET}/ \ --net_name ${NET_NAME} \ --options "{'save_kernel':''}"

(vitis-ai-caffe) Vitis-AI /workspace/model_test > bash compiler.sh


hill19850213 commented 3 years ago

Hi @qianglin-xlnx ,

I have checked the md5sum and it was same with latest md5sum.

(vitis-ai-caffe) root@hill213-pc:/workspace/Tool-Example/zu6eg_custom# md5sum cf_resnet50_imagenet_224_224_7.7G_1.3.zip 4ef5c8c680a52dc22252a9d82417d0bb cf_resnet50_imagenet_224_224_7.7G_1.3.zip (vitis-ai-caffe) root@hill213-pc:/workspace/Tool-Example/zu6eg_custom# bash custom_resnet50.sh


qianglin-xlnx commented 3 years ago

@hill19850213 When I use the other docker, I can reproduce the issue, as shown in the following figure. image

But when I use the xilinx/vitis-ai-cpu:latest docker, the compiling shows normal. So could you please check which docker do you use? Is it the same with the following? image image

hill19850213 commented 3 years ago

Hi @qianglin-xlnx ,

After I changed to xilinx/vitis-ai-cpu:latest, and there was new error as below: (vitis-ai-caffe) Vitis-AI /workspace/Tool-Example/zu6eg_custom > bash custom_resnet50.sh


Sitting

qianglin-xlnx commented 3 years ago

@hill19850213 It seems that /workspace/Tool-Example/zu6eg_custom folder don't have the write permission. Could you please check the properties of /workspace/Tool-Example/zu6eg_custom folder. image

hill19850213 commented 3 years ago

Hi @qianglin-xlnx ,

I don't know what happened after I set the permission to 777

(vitis-ai-caffe) Vitis-AI /workspace/Tool-Example/zu6eg_custom > bash custom_resnet50.sh


hill19850213 commented 3 years ago

Hi @qianglin-xlnx ,

Dose the arch.json need to update to vitis 1.3? I still use vitis 1.2 version as below:

{
    "target"   : "DPUCZDX8G",
    "dcf"      : "./dpu-11-02-2020-15-15.dcf",
    "cpu_arch" : "arm64"
}
hill19850213 commented 3 years ago

After I update the arch.json as below, it works fine for compilation

{
    "target"   : "DPUCZDX8G_ISA0_B4096_MAX_BG2",
    "dcf"      : "./dpu-11-02-2020-15-15.dcf",
    "cpu_arch" : "arm64"
}