# How to use tlt trained model on Jetson Nano

**URL:** <https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421>\
**Category:** TAO Toolkit\
**Tags:** tensorrt, jetson-inference\
**Created:** [August 19, 2020, 2:24am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421 "2020-08-19T02:24:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanser.z](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/lanser.z/32/20341_2.png) [@lanser.z](https://forums.developer.nvidia.com/u/lanser.z)\
**Post date:** [August 19, 2020, 2:24am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/1 "2020-08-19T02:24:28Z")

</div>

Hi, I trained an object-detection model in TLT following examples/detectnet\_v2 ipynb. Train & prune & inference & export work well and I got .tlt/.etlt file. How to use these files on Jetson Nano without Deepstream? Is there a python solution likes detectnet\_console.py in jetson-inference? Thanks.

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [August 19, 2020, 3:11am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/3 "2020-08-19T03:11:55Z")

</div>

Reference:

> [@Deploy .engine file in python](https://forums.developer.nvidia.com/t/deploy-engine-file-in-python/108911/2):
>
> Hi sharanssundar, For " deploy the model in python ", it is not the deploy way in current version of TLT. See [https://devtalk.nvidia.com/default/topic/1065558/transfer-learning-toolkit/trt-engine-deployment/](https://devtalk.nvidia.com/default/topic/1065558/transfer-learning-toolkit/trt-engine-deployment/) for reference. For “how to load the .engine model in python”, if you already generate a trt engine from etlt model, then your question becomes a TensorRT topic. See doc: [https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html](https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html) There are many python examples, esp…

> <https://github.com/NVIDIA/object-detection-tensorrt-example/blob/master/SSD_Model/utils/inference.py>

For preprocess or postprocess, refer to [Run PeopleNet with tensorrt](https://forums.developer.nvidia.com/t/run-peoplenet-with-tensorrt/128000/)

---

<div class="post-metadata">

**Author:** ![lanser.z](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/lanser.z/32/20341_2.png) [@lanser.z](https://forums.developer.nvidia.com/u/lanser.z)\
**Post date:** [August 19, 2020, 3:28am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/4 "2020-08-19T03:28:14Z")

</div>

Hi Morganh, thanks for your reference. I migrate the .trt engine to SSD example, and after do inference there are two outputs with correct dims. But I don’t know how to translate the outputs to bbox or label or something else. Maybe I missed any document about detectnet\_v2 or I should look forward source code of tlt-infer. Any suggestion?

---

<div class="post-metadata">

**Author:** ![lanser.z](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/lanser.z/32/20341_2.png) [@lanser.z](https://forums.developer.nvidia.com/u/lanser.z)\
**Post date:** [August 20, 2020, 4:50am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/5 "2020-08-20T04:50:32Z")

</div>

Is there any document about the network structure of detectnet\_v2? I have to extract bbox/labels from the outputs of tensorrt.

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [August 20, 2020, 5:54am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/6 "2020-08-20T05:54:10Z")

</div>

I am afraid [GitHub - NVIDIA-AI-IOT/deepstream\_tao\_apps: Sample apps to demonstrate how to deploy models trained with TAO on DeepStream](https://github.com/NVIDIA-AI-IOT/deepstream_tlt_apps) can help you.

> #### 2. Detectnet\_v2
> 
> The model has the following two outputs:
> 
> - **output\_cov/Sigmoid** : A [batchSize, Class\_Num, gridcell\_h, gridcell\_w] tensor contains the number of gridcells that are covered by an object
> - **output\_bbox/BiasAdd** : a [batchSize, Class\_Num, 4] contains the normalized image coordinates of the object (x1, y1) top left and (x2, y2) bottom right with respect to the grid cell

---

<div class="post-metadata">

**Author:** ![a428tm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@a428tm](https://forums.developer.nvidia.com/u/a428tm)\
**Post date:** [November 11, 2020, 2:13pm UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/8 "2020-11-11T14:13:14Z")

</div>

@Morganh

I am a bit confused as to how to use this.

Like the OG author, I followed the steps, and I was able to create fp16 version of trt from .etlt file on TX2 (thanks to you)

As a next step, Instead of using that trt file, I straight up ran the example you shared above - [object-detection-tensorrt-example/detect\_objects\_webcam.py at master · NVIDIA/object-detection-tensorrt-example · GitHub](https://github.com/NVIDIA/object-detection-tensorrt-example/blob/master/SSD_Model/detect_objects_webcam.py)

With this example, I am getting like 1.63 FPS (I used imutil package (via pip) to measure the FPS), but the output of the example said that the inference took 22ms or so for images.

As 1.63 FPS seems extremely slow, I wanted to check to see if there is normal or if I implemented something incorrectly.

Could it be that this was due to the fact that the SSD example uses SSD model rather than DetectNet? I wanted to test on DetectNet, but I couldn’t figure out what needs to be changed. Should I just update the model path within the file so it directs to the fp16 trt file I created following Transfer Learning Toolkit documentation?

Also, what’s weird is that when I run jetson-inference example ([jetson-inference/detectnet-camera-2.md at master · dusty-nv/jetson-inference · GitHub](https://github.com/dusty-nv/jetson-inference/blob/master/docs/detectnet-camera-2.md)), I saw that TX2 is capable of outputting 50-70 FPS. Not sure if this is the right place to direct my question, but I would appreciate it if you have any pointers.

Thanks you.

---

<div class="post-metadata">

**Author:** ![Morganh](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/morganh/32/9748_2.png) [@Morganh](https://forums.developer.nvidia.com/u/Morganh)\
**Post date:** [November 12, 2020, 8:58am UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/9 "2020-11-12T08:58:13Z")

</div>

For how to test the inference time, you can run trtexec.  
Reference: [Measurement model speed](https://forums.developer.nvidia.com/t/measurement-model-speed/154482/4)

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:24pm UTC](https://forums.developer.nvidia.com/t/how-to-use-tlt-trained-model-on-jetson-nano/147421/10 "2021-10-12T16:24:14Z")

</div>

Closed on October 12, 2021, 4:24pm UTC


