Tensorflow can't find TensoRT

52 Views Asked by At

I'm using tensorflow 2.16.1 on Ubuntu 22.04, tensorrt 10.0.0b6, but when I import tensorflow I get the warning:

W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

I already exported the path to my path inside bashrc, and sourced it, as follows:

## Python
export PYTHONPATH=${PYTHONPATH}:${HOME}:/usr/lib/python3/dist-packages:/home/belal/.local/lib/python3.10/site-packages
export PATH="/usr/local/bin:/home/belal/.local/bin:$PATH"
export PYTHONWARNINGS="ignore:Unverified HTTPS request"

## Exports
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib

## CUDA
export CUDA_PATH=/usr/local/cuda
export PATH=$CUDA_PATH/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_PATH/lib64:$LD_LIBRARY_PATH
## CUDNN
export CUDNN_PATH=/home/belal/.local/lib/python3.10/site-packages/nvidia/cudnn
export LD_LIBRARY_PATH=$CUDNN_PATH/lib:$LD_LIBRARY_PATH
export TF_ENABLE_ONEDNN_OPTS=0
## TensorRT
export LD_LIBRARY_PATH=/usr/lib/python3.10/dist-packages/tensorrt:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/belal/.local/lib/python3.10/site-packages/tensorrt_libs:$LD_LIBRARY_PATH

still the error persists, my library path looks like:

$ echo $LD_LIBRARY_PATH | grep tensorrt

/home/belal/.local/lib/python3.10/site-packages/tensorrt_libs:
/usr/lib/python3.10/dist-packages/tensorrt:
/home/belal/.local/lib/python3.10/site-packages/nvidia/cudnn/lib:
/usr/local/cuda/lib64:
/usr/local/lib:
/usr/lib

I have tried solutions in:

  1. Issue 61468
  2. SO Q 76788326
  3. discussion 18981

Can you please tell me how can I fix this issue? thanks

0

There are 0 best solutions below