Tensorrt version mismatch

Hello,

I installed tensorrt v4.0.1.6 and it was working totally fine. Recently, I installed the nvidia sdk manager, and I believe that it automatically installs a tensorrt v4.0.3 (which is not existing anywhere as a release from tensorrt), but anyways, after that, when I try to import tensorrt, it does not work, and I receive a version mismatch error like below

Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> import uff
>>> import tensorrt as trt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/tensorrt/__init__.py", line 82, in <module>
    raise ImportError('TensorRT Library mismatch, expected version ' + str(__version__) + ' got version ' + str(inferLibMajor) + '.' + str(inferLibMinor) + '.' + str(inferLibPatch))
ImportError: TensorRT Library mismatch, expected version 4.0.1.6 got version 4.0.3
>>> import tensorrt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/tensorrt/__init__.py", line 53, in <module>
    from tensorrt import __versions__
ImportError: cannot import name __versions__

I searched into my whole system for the tensorrt v4.0.3 and I was not able to locate it anywhere, I even don’t know where is this version installed, and it is not even in the synaptic or anywhere else

As a work around, I uninstalled the current tensorrt v4.0.1.6, and I tried to import it again in python, assuming that it should now import v4.0.3 (if available), and I received that no tensorrt is there

So I installed again v4.0.1.6, and then I receive the same error

Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> import uff
>>> import tensorrt as trt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/tensorrt/__init__.py", line 82, in <module>
    raise ImportError('TensorRT Library mismatch, expected version ' + str(__version__) + ' got version ' + str(inferLibMajor) + '.' + str(inferLibMinor) + '.' + str(inferLibPatch))
ImportError: TensorRT Library mismatch, expected version 4.0.1.6 got version 4.0.3
>>> import tensorrt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/tensorrt/__init__.py", line 53, in <module>
    from tensorrt import __versions__
ImportError: cannot import name __versions__

I really don’t know what the problem is and I am stuck now, since I cannot use tensorrt
my LD_LIBRARY_PATH is

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/python2.7/dist-packages/tensorrt/
export LD_LIBRARY_PATH=/usr/local/cuda/targets/aarch64-linux/lib:$LD_LIBRARY_PATH

Also, when I run

dpkg -l | grep TensorRT

I get this

ii  graphsurgeon-tf                                            4.1.2-1+cuda8.0                                       amd64        GraphSurgeon for TensorRT package
ii  libnvinfer-dev                                             4.1.2-1+cuda8.0                                       amd64        TensorRT development libraries and headers
ii  libnvinfer-samples                                         4.1.2-1+cuda8.0                                       amd64        TensorRT samples and documentation
ii  libnvinfer4                                                4.1.2-1+cuda8.0                                       amd64        TensorRT runtime libraries
ii  python-libnvinfer                                          4.1.2-1+cuda8.0                                       amd64        Python bindings for TensorRT
ii  python-libnvinfer-dev                                      4.1.2-1+cuda8.0                                       amd64        Python development package for TensorRT
ii  tensorrt                                                   4.0.1.6-1+cuda8.0                                     amd64        Meta package of TensorRT
ii  uff-converter-tf                                           4.1.2-1+cuda8.0                                       amd64        UFF converter for TensorRT package

which shows technically, that I do not have 4.0.3 version installed on my machine … so I don’t understand why do I receive this mismatch

hello,

NVIDIA SDK manager is designed for NVIDIA Drive family of products, not necessary for Linux host dev environment. Recommend completely uninstall TRT
https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html#uninstalling

then try installing again.

Hello,

this is exactly what I have done before, but again here it is.
So I did a complete uninstall following the instructions, and now I tried, and this what I received

Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> import uff
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named uff
>>> import tensorrt as trt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tensorrt

Which clearly means that I don’t have tensorrt, so now I did a new installation following the instructions below
https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html#installing-debian

I downloaded the version:
TensorRT 4.0.1.6 for Ubuntu 1604 and CUDA 8.0 DEB local repo packages
Now I try again, and here is what I get

Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> import uff
>>> import tensorrt as trt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/tensorrt/__init__.py", line 82, in <module>
    raise ImportError('TensorRT Library mismatch, expected version ' + str(__version__) + ' got version ' + str(inferLibMajor) + '.' + str(inferLibMinor) + '.' + str(inferLibPatch))
ImportError: TensorRT Library mismatch, expected version 4.0.1.6 got version 4.0.3

You mentioned the original tensorrt v4.0.1.6 installation worked fine. so there must be some latent piece of sw that still pointing to 4.0.3. I’m sorry about the inconvenience.

Instead of the .deb method, can you try the .tar method? You’ll have more control over the paths and what files are referenced.

good luck.

Thanks a lot :)
problem solved with the tar installation