Model Conversion and Deployment - 1.4.1 English

Vitis AI Optimizer User Guide (UG1333)

Document ID
UG1333
Release Date
2021-10-29
Version
1.4.1 English

Because Vitis AI only supports the deployment of TensorFlow, PyTorch, and Caffe models, it is necessary to convert a Darknet model to a deployable model format. An open source conversion tool converts darknet model to Caffe model is included in Caffe_xilinx. Convert Darknet model to Caffe and then follow Vitis AI User Guide to deploy a Caffe model to FPGA.

Convert Darknet model to Caffe model

The easiest way to convert a Darknet model to Caffe model is running convert.py script under conda environment "vitis-ai-caffe" in Vitis AI docker container.

conda activate vitis-ai-caffe

The following is an example of converting a YOLOv3 model.

cd scripts
python convert.py ../pruning/model-transform.cfg ../pruning/weights.transform yolov3.prototxt yolov3.caffemode

Refer to Vitis AI User Guide for more information on the Docker container. You can also run the conversion without "vitis-ai-caffe" conda environment. In this case, first build Caffe, then build pyCaffe, and finally run convert.py.