Skip to main content

A standalone package to do the vitis quantization step.

Project description

Vitis Quantizer

THIS IS NOT AN OFFICIAL XILINX PACKAGE

A pip installable package to do the vitis model quantization for tensorflow 2.

This is a migration of the code here to a standalone pip package that won't conflict with the tensorflow-model-optimization package.

Working in the docker image is annoying and this code should be standalone.

Install

pip install vitis-quantizer

Build from source:

python3 setup.py bdist_wheel
pip install dist/vitis_quantizer-0.1.0-py3-none-any.whl

Usage

Usage is the same as Vitis AI models.

import tensorflow as tf
import vitis_quantizer

# Train/Get/Make a keras model somehow
model = tf.keras.models.load_model("/path/to/keras/model")
quantizer = vitis_quantizer.VitisQuantizer(model)
with vitis_quantizer.quantize_scope():
    quantized_model = quantizer.quantize_model(calib_dataset=dataset)
    quantized_model.save("/path/to/save/quantized/model")

After you have the quantized model saved, use vitis compile.sh script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vitis-quantizer-0.1.2.tar.gz (171.6 kB view details)

Uploaded Source

File details

Details for the file vitis-quantizer-0.1.2.tar.gz.

File metadata

  • Download URL: vitis-quantizer-0.1.2.tar.gz
  • Upload date:
  • Size: 171.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for vitis-quantizer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3f97f90a8ef4c7e66e6b99d2271b67a66bc5479b11d20fbb44fb792504257190
MD5 be20352d032821a11ac4683a5b62869e
BLAKE2b-256 fb3dabc8761d5a645a2dc3fd47d7335faf72473fd480b9af9e1a34984e49e08a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page