Mxnet 1.6 - TensorRT not working


I am trying to optimize mxnet models using it’s contrib.tensorrt module. I am following this tutorial:

However, the following line causes an error:

trt_sym = sym.get_backend_symbol('TensorRT')



Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/mxnet/symbol/", line 2717, in get_backend_symbol
    check_call(_LIB.MXGenBackendSubgraph(self.handle, c_str(backend), ctypes.byref(out)))
  File "/usr/local/lib/python3.6/dist-packages/mxnet/", line 255, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [15:07:42] src/c_api/../operator/subgraph/subgraph_property.h:502: Check failed: it != backend_map_.end(): SubgraphProperty TensorRt is not found in SubgraphBackendRegistry
Stack trace:
  [bt] (0) /usr/local/mxnet/ [0x7f7662eebc]
  [bt] (1) /usr/local/mxnet/<char, std::char_traits<char>, std::allocator<char> > const&)+0x150) [0x7f79b80268]
  [bt] (2) /usr/local/mxnet/ [0x7f79b78750]
  [bt] (3) /usr/lib/aarch64-linux-gnu/ [0x7fa83bfd28]
  [bt] (4) /usr/lib/aarch64-linux-gnu/ [0x7fa83c0698]
  [bt] (5) /usr/lib/python3.6/lib-dynload/ [0x7fa83e31ac]
  [bt] (6) /usr/lib/python3.6/lib-dynload/ [0x7fa83e34c0]
  [bt] (7) python3(_PyObject_FastCallDict+0xd0) [0x6057e0]
  [bt] (8) python3() [0x529738]

I am using mxnet 1.6 installed from the precompiled wheel. (

It seems that this error is caused because this wheel was not build with the USE_TENSORRT option. I tried to compile mxnet from source with the USE_TENSORRT option but it asks for cmake version 3.13, and the latest in jetson Xavier is 3.10.


I’m not sure if we added the TensorRT support when building the package.

Maybe you can also build it from source for us.
The cmake 3.13 can be upgraded with these command:

tar xpvf cmake-3.13.0.tar.gz cmake-3.13.0/
cd cmake-3.13.0/
./bootstrap --system-curl 
make -j8
echo 'export PATH=/home/nvidia/cmake-3.13.0/bin/:$PATH' >> ~/.bashrc
source ~/.bashrc