# Does TensorRT Python API support uff model int8 calibration

**URL:** <https://forums.developer.nvidia.com/t/does-tensorrt-python-api-support-uff-model-int8-calibration/77506>\
**Category:** TensorRT\
**Created:** [July 4, 2019, 8:09am UTC](https://forums.developer.nvidia.com/t/does-tensorrt-python-api-support-uff-model-int8-calibration/77506 "2019-07-04T08:09:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![67924069](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@67924069](https://forums.developer.nvidia.com/u/67924069)\
**Post date:** [July 4, 2019, 8:09am UTC](https://forums.developer.nvidia.com/t/does-tensorrt-python-api-support-uff-model-int8-calibration/77506/1 "2019-07-04T08:09:04Z")

</div>

I only saw there is an example of int8 calibration for caffemodel, not sure if it’s also ok for uff

…  
66 class ModelData(object):  
67 DEPLOY\_PATH = “deploy.prototxt”  
68 MODEL\_PATH = “mnist\_lenet.caffemodel”  
69 OUTPUT\_NAME = “prob”  
70 # The original model is a float32 one.  
71 DTYPE = trt.float32  
72  
73 # This function builds an engine from a Caffe model.  
74 def build\_int8\_engine(deploy\_file, model\_file, calib):  
75 with trt.Builder(TRT\_LOGGER) as builder, builder.create\_network() as network, trt.CaffeParser() as parser:  
76 # We set the builder batch size to be the same as the calibrator’s, as we use the same batches  
77 # during inference. Note that this is not required in general, and inference batch size is  
78 # independent of calibration batch size.  
79 builder.max\_batch\_size = calib.get\_batch\_size()  
80 builder.max\_workspace\_size = common.GiB(1)  
81 builder.int8\_mode = True  
82 builder.int8\_calibrator = calib

---

<div class="post-metadata">

**Author:** ![NVES\_R](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nves_r/32/14043_2.png) [@NVES\_R](https://forums.developer.nvidia.com/u/NVES_R)\
**Post date:** [July 11, 2019, 10:00pm UTC](https://forums.developer.nvidia.com/t/does-tensorrt-python-api-support-uff-model-int8-calibration/77506/2 "2019-07-11T22:00:46Z")

</div>

Hi,

Yes, see sample\_uff\_ssd here: [url][Sample Support Guide :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html#uffssd_sample%5B/url%5D)

This has int8 instructions as well.

Thanks,  
NVIDIA Enterprise Support
