量化 - 3.5 简体中文

Vitis AI 用户指南 (UG1414)

Document ID
UG1414
Release Date
2023-09-28
Version
3.5 简体中文
  1. 启动 Docker 镜像:
    
    [Host]$ cd Vitis-AI
    [Host]$ ./docker_run.sh xilinx/vitis-ai-cpu:latest
  2. 下载模型源代码包 tf2_custom_op_demo.tar.gz
    
    [Docker]$ wget https://www.xilinx.com/bin/public/openDownload?filename=tf2_custom_op_demo.tar.gz -O tf2_custom_op_demo.tar.gz
    [Docker]$ tar -xzvf tf2_custom_op_demo.tar.gz
    [Docker]$ cd tf2_custom_op_demo
  3. 量化:
    
    [Docker]$ conda activate vitis-ai-tensorflow2
    [Docker]$ bash 1_run_train.sh
    [Docker]$ bash 3_run_quantize.sh

量化后,./quantized/ 目录下会生成名为 quantized.h5 的量化模型。