Yolov5 + TensorRT results seems weird on Jetson Nano 4GB


I’m trying to inference Yolov5 with TensorRT on Jetson Nano 4GB, However, the result is quite weird since using original ‘yolov5s.pt’, the inference speed is faster (~120ms) than when using ‘yolov5s.engine’ generated from the producer export.py (~140ms).


TensorRT Version: TensorRT 8.0.1
GPU Type: Jetson Nano GPU
CUDA Version: CUDA 10.2
CUDNN Version: CUDNN 8.2.1
Operating System + Version: Ubuntu 18.04
Python Version (if applicable): Python 3.6.9
PyTorch Version (if applicable): Pytorch v1.10.0

Relevant Files

Here is the link to my video (1920x1080): 1080p.mp4 - Google Drive

Steps To Reproduce

First, from the original yolov5s.pt, I use this command line to produce TensorRT yolov5s.engine file:

python3 export.py --weights yolov5s.pt --include engine --imgsz 640 640 --device 0

Then, I started inference with this .engine file:

python3 detect.py --weights yolov5s.engine --imgsz 640 640 --device 0 --source ./data/images/1080p.mp4

The result was about ~140ms inferencing on each frames. [link_image]

But when comparing to the original path file with:

python3 detect.py --weights yolov5s.pt --imgsz 640 640 --device 0 --source ./data/images/1080p.mp4

The result was about ~120ms inferencing on each frames [link_images]

Please help me !!!

This looks like a Jetson issue. Please refer to the below samlples in case useful.

For any further assistance, we recommend you to raise it to the respective platform from the below link


I found the way to fix the problem. Thank you btw.

Can you tell us the workaround to solve the problem? Ca n you tell de ms you get with the jetson?

Hi @usuario2507, the problem I got was all about the img size input for inference. At first I tried Yolov5 originally with 640x480, but when I export the engine file, I forgot to change, so the inference size was 640x640, which led to weird results with TensorRT.
It was about 70ms for each frame on Jetson Nano, with 640x480 imgsz .engine file.

intel 6305 peaked at 100fps its a nuc but its much faster than jetson