cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
347 Views
Registered: ‎12-25-2018

Vitis AI v1.3 compile problem on docker image xilinx/vitis-ai-cpu

Hi AI Team,

Recently, I downloaded Vitis AI v1.3 library on to my Ubuntu OS virtual machine (18.04.2).

I use docker script to build xilinx/vitis-ai-cpu image as shown below.

REPOSITORY           TAG             IMAGE ID                CREATED           SIZE
xilinx/vitis-ai-cpu        latest            2d0bac5f663a         17 hours ago       24.2GB
ubuntu                       18.04            c090eaba6b94        13 days ago         63.3MB

I also downloaded AI model tf_yolov3_voc_416_416_65.63G_1.3

I use the following command to compile this model but it fails to compile to xmodel.

I use this script custom_platform_compile_test.sh to perform the compile as shown below:

 

NET_NAME=yolov3_voc
TF_NETWORK_PATH=./tf_yolov3_voc_416_416_65.63G_1.3
DPU_MODE=normal
COMPILE=./compiled/

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


vai_c_tensorflow --frozen_pb ${TF_NETWORK_PATH}/quantized/quantize_eval_model.pb \
--arch ${ARCH} \
--output_dir ${COMPILE} \
--net_name ${NET_NAME} \
--options "{'mode':'${DPU_MODE}'}"

 

 

The result I get is shown below.

(vitis-ai-tensorflow) Vitis-AI /workspace/test > sh custom_platform_compile_test.sh
**************************************************
* VITIS_AI Compilation - Xilinx Inc.
**************************************************
Illegal instruction (core dumped)
(vitis-ai-tensorflow) Vitis-AI /workspace/test >

 

May I know what is the problem? Is the compile command ok? Thanks.

Previously when I use Vitis AI v1.2, I am able to compile Yolov3, Densebox and Resnet models.

 

Regards

YE

 

0 Kudos
3 Replies
linqiang
Xilinx Employee
Xilinx Employee
244 Views
Registered: ‎05-10-2019

Hi yan-eng.ang@leica-microsystems.com 

I made a little change to your script, as shown below.

(vitis-ai-tensorflow) linqiang@xxxxxxxxx:/workspace/model_test$ cat custom_platform_compile_test.sh
NET_NAME=yolov3_voc
TF_NETWORK_PATH=./tf_yolov3_voc_416_416_65.63G_1.3
DPU_MODE=normal
COMPILE=./compiled/

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


vai_c_tensorflow --frozen_pb ${TF_NETWORK_PATH}/quantized/quantize_eval_model.pb \
--arch ${ARCH} \
--output_dir ${COMPILE} \
--options '{"input_shape": "1,416,416,3"}' \
--net_name ${NET_NAME}

 

And it works, as shown below.

(vitis-ai-tensorflow) linqiang@xxxxxxxxxx:/workspace/model_test$ sh custom_platform_compile_test.sh
**************************************************
* VITIS_AI Compilation - Xilinx Inc.
**************************************************
[INFO] Namespace(inputs_shape=['1,416,416,3'], layout='NHWC', model_files=['./tf_yolov3_voc_416_416_65.63G_1.3/quantized/quantize_eval_model.pb'], model_type='tensorflow', out_filename='./compiled//yolov3_voc_org.xmodel', proto=None)
in_shapes: [[1, 416, 416, 3]]
[INFO] tensorflow model: tf_yolov3_voc_416_416_65.63G_1.3/quantized/quantize_eval_model.pb
[INFO] parse raw model     :100%|#####################################| 366/366 [00:00<00:00, 20094.18it/s]
[INFO] infer shape (NHWC)  :100%|#####################################| 296/296 [00:00<00:00, 1985.25it/s]
[INFO] infer shape (NHWC)  :100%|#####################################| 290/290 [00:00<00:00, 1979.02it/s]
[INFO] generate xmodel     :100%|#####################################| 290/290 [00:00<00:00, 342.15it/s]
[INFO] generate xmodel: /workspace/model_test/compiled/yolov3_voc_org.xmodel
[UNILOG][INFO] The compiler log will be dumped at "/tmp/linqiang/log/xcompiler-20210208-091257-181"
[UNILOG][INFO] Target architecture: DPUCZDX8G_ISA0_B4096_MAX_BG2
[UNILOG][INFO] Compile mode: dpu
[UNILOG][INFO] Debug mode: function
[UNILOG][INFO] Target architecture: DPUCZDX8G_ISA0_B4096_MAX_BG2
[UNILOG][INFO] Graph name: quantize_eval_model, with op num: 590
[UNILOG][INFO] Begin to compile...
[UNILOG][INFO] Total device subgraph number 7, DPU subgraph number 1
[UNILOG][INFO] Compile done.
[UNILOG][INFO] The meta json is saved to "/workspace/model_test/./compiled/meta.json"
[UNILOG][INFO] The compiled xmodel is saved to "/workspace/model_test/./compiled//yolov3_voc.xmodel"
[UNILOG][INFO] The compiled xmodel's md5sum is 0a88a3158faad824e29073754a288895, and been saved to "/workspace/model_test/./compiled/md5sum.txt"

 

0 Kudos
222 Views
Registered: ‎12-25-2018

Hi linqiang,

I am still getting the same error as shown below.

 

(vitis-ai-tensorflow) Vitis-AI /workspace/test > cat custom_platform_compile_test.sh
#!/bin/sh

# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


NET_NAME=yolov3_voc
TF_NETWORK_PATH=./tf_yolov3_voc_416_416_65.63G_1.3
DPU_MODE=normal
COMPILE=./compiled/

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


vai_c_tensorflow --frozen_pb ${TF_NETWORK_PATH}/quantized/quantize_eval_model.pb \
--arch ${ARCH} \
--output_dir ${COMPILE} \
--options '{"input_shape": "1,416,416,3"}' \
--net_name ${NET_NAME}


(vitis-ai-tensorflow) Vitis-AI /workspace/test > sh custom_platform_compile_test.sh
**************************************************
* VITIS_AI Compilation - Xilinx Inc.
**************************************************
Illegal instruction (core dumped)
(vitis-ai-tensorflow) Vitis-AI /workspace/test > sh custom_platform_compile_test.sh
**************************************************
* VITIS_AI Compilation - Xilinx Inc.
**************************************************
Illegal instruction (core dumped)
(vitis-ai-tensorflow) Vitis-AI /workspace/test >

 

I am using the following image to compile. Are you using this image? 

REPOSITORY             TAG            IMAGE ID             CREATED           SIZE
xilinx/vitis-ai-cpu          latest           2d0bac5f663a      5 days ago           24.2GB

 

Regards

YE

0 Kudos
linqiang
Xilinx Employee
Xilinx Employee
200 Views
Registered: ‎05-10-2019

0 Kudos