# TensorRT 4.0 Python API INT8 Calibration

**URL:** <https://forums.developer.nvidia.com/t/tensorrt-4-0-python-api-int8-calibration/60837>\
**Category:** TensorRT\
**Created:** [April 30, 2018, 3:44pm UTC](https://forums.developer.nvidia.com/t/tensorrt-4-0-python-api-int8-calibration/60837 "2018-04-30T15:44:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![counterpart](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@counterpart](https://forums.developer.nvidia.com/u/counterpart)\
**Post date:** [April 30, 2018, 3:44pm UTC](https://forums.developer.nvidia.com/t/tensorrt-4-0-python-api-int8-calibration/60837/1 "2018-04-30T15:44:32Z")

</div>

Hi:  
It seems that some Python APIs about Int8 calibration are provided in TensorRT 4.0 but I can’t find any sample code in the documentation. Could you provide some examples showing whole workflow to quantize CNN models (LeNet, ResNet, etc.)? BTW, I wonder if TX2 is capable of INT8 inference?  
Thanks.

---

<div class="post-metadata">

**Author:** ![ChrisGottbrath](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ChrisGottbrath](https://forums.developer.nvidia.com/u/ChrisGottbrath)\
**Post date:** [May 2, 2018, 1:18am UTC](https://forums.developer.nvidia.com/t/tensorrt-4-0-python-api-int8-calibration/60837/2 "2018-05-02T01:18:16Z")

</div>

TX2 doesn’t have the hardware to do INT8.

The python API for INT8 calibration is documented at

> **[API Reference :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/api/)**
>
> This is the API Reference documentation for the NVIDIA TensorRT library. The following set of APIs allows developers to import pre-trained models, calibrate networks for INT8, and build and deploy optimized networks with TensorRT. Networks can be...

Python workflows are documented at

> **[Developer Guide :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html)**
>
> This is the revision history of the NVIDIA TensorRT 8.4 Developer Guide.

---

<div class="post-metadata">

**Author:** ![counterpart](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@counterpart](https://forums.developer.nvidia.com/u/counterpart)\
**Post date:** [May 2, 2018, 3:16am UTC](https://forums.developer.nvidia.com/t/tensorrt-4-0-python-api-int8-calibration/60837/3 "2018-05-02T03:16:39Z")

</div>

I am looking for examples on how to use Python Int8Calibrator, which I can’t find in the developer guild. There is only a C++ SampleINT8.

---

<div class="post-metadata">

**Author:** ![gabriel.filipek](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@gabriel.filipek](https://forums.developer.nvidia.com/u/gabriel.filipek)\
**Post date:** [August 27, 2018, 11:21am UTC](https://forums.developer.nvidia.com/t/tensorrt-4-0-python-api-int8-calibration/60837/4 "2018-08-27T11:21:55Z")

</div>

Has anyone found a good source on python int8 inference? Some methods in my calibrator are not working and since I dont have an access to the tensorrt source code I can’t figure out what’s wrong (my code is based on: [https://devblogs.nvidia.com/int8-inference-autonomous-vehicles-tensorrt/](https://devblogs.nvidia.com/int8-inference-autonomous-vehicles-tensorrt/)).
