Installing vai_q_tensorflow2 - 1.4.1 English

Vitis AI User Guide (UG1414)

Document ID
Release Date
1.4.1 English

You can install vai_q_tensorflow2 in the following two ways:

Install Using Docker Container

Vitis AI provides a Docker container for quantization tools, including vai_q_tensorflow. After running a container, activate the Conda environment vitis-ai-tensorflow2.

conda activate vitis-ai-tensorflow2

If there is a patch package, install the vitis-ai-tensorflow2 patch package inside the Docker container.

# [optional]
$ sudo env CONDA_PREFIX=/opt/vitis_ai/conda/envs/vitis-ai-tensorflow2/ PATH=/opt/vitis_ai/conda/bin:$PATH conda install patch_package.tar.bz2

Install from Source Code with the Wheel Package

vai_q_tensorflow2 is a fork of TensorFlow Model Optimization Toolkit. It is open source in Vitis_AI_Quantizer. To build vai_q_tensorflow2, run the following command:

$ sh
$ pip install pkgs/*.whl

Install from Source Code with the Conda Package

Important: This requires Anaconda.

# CPU-only version
$ conda build vai_q_tensorflow2_cpu_feedstock --output-folder ./conda_pkg/
# GPU version
$ conda build vai_q_tensorflow2_gpu_feedstock --output-folder ./conda_pkg/
# Install conda package on your machine
$ conda install --use-local ./conda_pkg/linux-64/*.tar.bz2