ModuleNotFoundError: No module named 'uff'

I try to convert mars-small128.pb to tensorrt.

Therefore I import the following libraries:
import tensorflow as tf
import uff
import tensorrt as trt
import pycuda.driver as cuda
import pycuda.autoinit
from tensorrt.parsers import uffparser

However, I discover the problem that ModuleNotFoundError: No module named ‘uff’
So I use jtop to check that I installed tensorrt 7.1.3.0 and try to install Python UFF wheel file with the command that sudo pip2 install uff-0.6.9-py2.py3-none-any.whl.
But it cant tackle the problem.
What should I do ?thank you

Hi,

Are you using python2.7?
If yes, please try python3 instead.

uff is one of the JetPack components and it should be installed automatically by SDKmanager.
You can verify by this command:

$ dpkg -l | grep TensorRT


ii uff-converter-tf 7.1.3-1+cuda10.2 arm64 UFF converter for TensorRT package

Thanks

ii graphsurgeon-tf 7.1.3-1+cuda10.2 arm64 GraphSurgeon for TensorRT package
ii libnvinfer-bin 7.1.3-1+cuda10.2 arm64 TensorRT binaries
ii libnvinfer-dev 7.1.3-1+cuda10.2 arm64 TensorRT development libraries and headers
ii libnvinfer-doc 7.1.3-1+cuda10.2 all TensorRT documentation
ii libnvinfer-plugin-dev 7.1.3-1+cuda10.2 arm64 TensorRT plugin libraries
ii libnvinfer-plugin7 7.1.3-1+cuda10.2 arm64 TensorRT plugin libraries
ii libnvinfer-samples 7.1.3-1+cuda10.2 all TensorRT samples
ii libnvinfer7 7.1.3-1+cuda10.2 arm64 TensorRT runtime libraries
ii libnvonnxparsers-dev 7.1.3-1+cuda10.2 arm64 TensorRT ONNX libraries
ii libnvonnxparsers7 7.1.3-1+cuda10.2 arm64 TensorRT ONNX libraries
ii libnvparsers-dev 7.1.3-1+cuda10.2 arm64 TensorRT parsers libraries
ii libnvparsers7 7.1.3-1+cuda10.2 arm64 TensorRT parsers libraries
ii python-libnvinfer 7.1.3-1+cuda10.2 arm64 Python bindings for TensorRT
ii python-libnvinfer-dev 7.1.3-1+cuda10.2 arm64 Python development package for TensorRT
ii tensorrt 7.1.3.0-1+cuda10.2 arm64 Meta package of TensorRT
ii uff-converter-tf 7.1.3-1+cuda10.2 arm64 UFF converter for TensorRT package

Yes , I found ii uff-converter-tf 7.1.3-1+cuda10.2 arm64 UFF converter for TensorRT package
and I try to use python3 to import library, but it doesn’t work

Hi,

To import uff, you will need to get the TensorFlow v1.15.x installed first.
Please following this document to install TensorFlow on NX.

$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uff
2020-09-30 11:00:34.460281: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.2
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
>>> 

Thanks.

Hi @AastaLLL ,

I installed TensorFlow 1.15.2 and I can see <ii uff-converter-tf 7.1.3-1+cuda10.2 arm64 UFF converter for TensorRT package> but when I import uff, it still get error. How can I fix it?

Thank you

Hi nampq.aime,

Please help to open a new topic for your issue. Thanks