Jetson Nano 2 GB tensorrt Not Found

Hello,

I am attempting to run TensorRT inference of YOLO models on a Jetson Nano 2 GB. However, when I try to run my code, it says that tensorrt is not found (at the end, “No module named ‘tensorrt’”). I know that this issue has been resolved in the past with

$ sudo apt install python3-libnvinfer*

but I have done this and it still gives the same error. Does anyone know why this is the case? It may be due to the “does not currently build wheels for Tegra systems,” but I am not sure what this means.

Thank you!

TensorRT needs to be installed using SDK Manager

Thank you for the suggestion. However, I do not believe this is the issue; doesn’t TensorRT come installed already when you first flash the device with SDKManager?

I also ran

$ apt show nvidia-tensorrt

and got the following result, which shows TensorRT is already installed.

Are you using the default Python environment?

If you’re using venv, then you probably need to use --system-site-package when creating the venv.

Hi,

Based on your error message, pip tries to install a TensorRT built for CUDA 13.
Could you share more details about the command you ran?

Which Python version do you use? 2.7, 3.6, or other?
Thanks.

Hi,

I am running Python 3.8, and I had built PyTorch from source to be compatible. When I do

dpkg -l | grep nvinfer

it’s giving me 8.2.1-1+cuda10.2, if that’s useful.

For the command, I ran a Python script to run YOLO predictions from my TensorRT engines via model = YOLO(args.engine) and model.predict(). Here are some more detailed logs. I also tried setting include-system-site-packages to true in the venv and reactivating, but it didn’t resolve the issue.

Thanks.

Does import tensorrt work without activating venv?

Sorry, I should have checked this earlier. It works (TRT version 8.2.1.9) when I am in Python 3.6.9 (which came installed with the Nano), but not when I am in Python 3.8.18 (which I installed myself). Is there a way to get around this if I need to stay within 3.8?

I found this previous thread which seems to be useful. I just need to make sure that I’m installing the same version for the bindings that is in the binaries (8.2.1), right? Do I need to worry about CUDA version?

There is no update from you for a period, assuming this is not an issue anymore.
Hence, we are closing this topic. If need further support, please open a new one.
Thanks
~1105

Is this still an issue to support? Any result can be shared?