Cannot convert model objectDetector_SSD to TensorRT

I follow the instruction in the README file in objectDetector_SSD.

I’ve installed tensorflow-gpu and all the items as per the README. But I cannot convert the graph to UFF as per the instruction

# I change python to python3, /usr/lib/python2.7 to /usr/lib/python3.6
python3 /usr/lib/python3.6/dist-packages/uff/bin/ \
         frozen_inference_graph.pb -O NMS \
         -p /usr/src/tensorrt/samples/sampleUffSSD/ \
         -o sample_ssd_relu6.uff

The output as follow

> python3 /usr/lib/python3.6/dist-packages/uff/bin/ frozen_inference_graph.pb -O NMS -p /usr/src/tensorrt/samples/sampleUffSSD/ -o sample_ssd_relu6.uff
Traceback (most recent call last):
  File "/usr/lib/python3.6/dist-packages/uff/bin/../../uff/converters/tensorflow/", line 19, in <module>
    import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/dist-packages/uff/bin/", line 18, in <module>
    import uff
  File "/usr/lib/python3.6/dist-packages/uff/bin/../../uff/", line 2, in <module>
    from uff.converters.tensorflow.conversion_helpers import from_tensorflow  # noqa
  File "/usr/lib/python3.6/dist-packages/uff/bin/../../uff/converters/tensorflow/", line 12, in <module>
    from .converter_functions import *  # noqa
  File "/usr/lib/python3.6/dist-packages/uff/bin/../../uff/converters/tensorflow/", line 12, in <module>
    from uff.converters.tensorflow.converter import TensorFlowToUFFConverter as tf2uff
  File "/usr/lib/python3.6/dist-packages/uff/bin/../../uff/converters/tensorflow/", line 24, in <module>""".format(err))
ImportError: ERROR: Failed to import module (No module named 'tensorflow')
Please make sure you have TensorFlow installed.
For installation instructions, see:

Do I need to install tensorflow seperately?

Please help!


tensorflow-gpu should be enough for ‘import tensorflow’.

Would you mind to reinstall the TensorFlow package again?
It looks like the package is somehow not well installed.


@AastaLLL: Thank you for your reply.

I reinstalled the tensorflow-gpu, it now can load the tensorflow, however, now it said

ImportError: cannot import name 'GraphDef'

Thank you for your help


Are you using TensorFlow v2.0?
Please noticed that TFv2.0 support is added from the TRTv7.1, which is not available for Jetson yet.

You will need to use the TF v1.1x package instead.