tensorflow/tensorrt

how can I link tensorflow with tensorrt specific version?

suhyung-code42 opened this issue · 1 comments

I have installed various TensorRT versions. and below is my system.

(tf2.0) suhyung@suhyung:~$ dpkg -l | grep nvinfer
ii libnvinfer-bin 7.0.0-1+cuda10.0 amd64 TensorRT binaries
ii libnvinfer-dev 7.0.0-1+cuda10.0 amd64 TensorRT development libraries and headers
ii libnvinfer-dev-cross-aarch64 5.0.3-1+cuda10.0 all TensorRT cross development libraries and headers
ii libnvinfer-doc 7.0.0-1+cuda10.0 all TensorRT documentation
ii libnvinfer-plugin-dev 7.0.0-1+cuda10.0 amd64 TensorRT plugin libraries
ii libnvinfer-plugin7 7.0.0-1+cuda10.0 amd64 TensorRT plugin libraries
ii libnvinfer-samples 7.0.0-1+cuda10.0 all TensorRT samples
ii libnvinfer5 5.0.2-1+cuda10.0 amd64 TensorRT runtime libraries
ii libnvinfer5-cross-aarch64 5.0.3-1+cuda10.0 all TensorRT cross compilation runtime libraries
ii libnvinfer6 6.0.1-1+cuda10.0 amd64 TensorRT runtime libraries
ii libnvinfer7 7.0.0-1+cuda10.0 amd64 TensorRT runtime libraries
ii python3-libnvinfer 7.0.0-1+cuda10.0 amd64 Python 3 bindings for TensorRT
ii python3-libnvinfer-dev 7.0.0-1+cuda10.0 amd64 Python 3 development package for TensorRT

I am checking tensorrt version which is linked with tensorflow using below code

from tensorflow.compiler.tf2tensorrt.wrap_py_utils import get_linked_tensorrt_version
from tensorflow.compiler.tf2tensorrt.wrap_py_utils import get_loaded_tensorrt_version
import tensorflow
compiled_version = get_linked_tensorrt_version()
loaded_version = get_loaded_tensorrt_version()
tensorflow_version = tensorflow.version
print("Linked TensorRT version: %s" % str(compiled_version))
print("Loaded TensorRT version: %s" % str(loaded_version))
print("TensorFlow version: %s" %str(tensorflow_version))

and result is shown like below

Linked TensorRT version: (5, 1, 5)
Loaded TensorRT version: (5, 0, 3)
TensorFlow version: 2.0.0
`

I don't understand why 5.1.5 and 5.0.3 are shown.

This is the sequence of work I've done.

  1. install tensorrt 5.x
  2. install tensorrt 6.x
  3. install tensorrt 7.x
  4. make conda env (tf2.0)
  5. install tensorflow-gpu==2.0 on conda env

But as you see, tensorflow is linked with 5.x
How can I link with 7.0 ?

Additionally, I am using CUDA 10.0.
Thank you

If user want to use specific version library with tf, user should build install binary by self after setting configure.