Installing vai_q_tensorflow2 - 3.5 English

Vitis AI User Guide (UG1414)

Document ID
Release Date
3.5 English

You can install vai_q_tensorflow2 in the following three ways:

Install Using Docker Container

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

[docker] $ conda activate vitis-ai-tensorflow2

If there is a patch package, install the Vitis AI-tensorflow2 patch package inside the Docker container.

# [optional]
[docker] $ 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 TensorFlow Model Optimization Toolkit fork. It is open source in Vitis_AI_Quantizer. To build vai_q_tensorflow2, run the following command:

[host] $ sh
[host] $ pip install pkgs/*.whl

Install from Source Code with the Conda Package

Important: This requires Anaconda.

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