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.
Metadata
Release files for vitis-quantizer 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vitis-quantizer-0.1.3.tar.gz | 171.6 kB | Details |
Release files / vitis-quantizer-0.1.3.tar.gz
| Download URL | vitis-quantizer-0.1.3.tar.gz |
|---|---|
| Size | 171.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cbbea0b9709e510649c47188a2ed350ec3ab60763bf3e7d08072d9a3f0188ff
|
|
BLAKE2b-256 checksum How to use checksums |
5ab03d0be902784057ee60ba98c697eaa51d419d1bbb54e3687771fb66b1abce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|