jetson-tf_to_trt_image_classification

Hi!,
is there any way to execute the “two days to a demo #3 - jetson-tf_to_trt_image_classification” on Xavier Ubuntu 18.04, TensorRT.5.0.0.10 (in place of 3.0.4) and Tensorflow for CUDA 10 (instead of Tensorflow 1.5) ?

I cannot execute make :
uff_to_plan.cpp failed

Thanks a lot for help

Hi,

I got the same issue with the following errors :
src/uff_to_plan.cpp:71:79: error: no matching function for call to
‘nvuffparser::IUffParser::registerInput(const char*, nvinfer1::DimsCHW)’

And what I did is just close/open the terminal then run again and it worked :
$ cmake …
$ make

Fyi, here are the results of test_trt.py and test_tf.py at MAX & jetson_clocks enabled.

TensorRT
data/plans/vgg_16.plan 11.5038
data/plans/inception_v1.plan 2.70743
data/plans/inception_v3.plan 9.95005
data/plans/inception_v4.plan 18.5168
data/plans/inception_resnet_v2.plan 18.3958
data/plans/resnet_v2_50.plan 6.37158
data/plans/resnet_v2_101.plan 10.8947
data/plans/resnet_v2_152.plan 15.2994
data/plans/mobilenet_v1_1p0_224.plan 3.67673
data/plans/mobilenet_v1_0p5_160.plan 2.58504
data/plans/mobilenet_v1_0p25_128.plan 2.30188

Tensorflow
gg_16 4106.8732261657715
inception_v1 14.59348201751709
inception_v2 17.311182022094727
inception_v3 30.183029174804688
inception_v4 56.04306221008301
inception_resnet_v2 67.72186756134033
resnet_v1_50 23.297419548034668
resnet_v1_101 41.227407455444336
resnet_v1_152 57.889719009399414
resnet_v2_50 30.728168487548828
resnet_v2_101 54.718194007873535
resnet_v2_152 79.46367740631104
mobilenet_v1_1p0_224 8.14089298248291
mobilenet_v1_0p5_160 7.229905128479004
mobilenet_v1_0p25_128 7.330756187438965

Hi! thanks for your replay, ndnparis.

I’ll try when I’ll be at xavier’s desk.

It seems that something is related to PATH ? open&close terminal means rerun ~/.bashrc.

I’ll try! get in touch

Hi,

Do you use the TensorFlow package built for Xavier?
[url]https://devtalk.nvidia.com/default/topic/1042125/jetson-agx-xavier/official-tensorflow-for-jetson-agx-xavier/[/url]

We will test these two tutorial to see if any changes is needed.

Thanks.

Thank you very much for your promise to deliver jetson-tf_to_trt_image_classification tutorial for Xavier.

I’m confirming: I’m using the last tensorflow 1.10-nv18.10 for both python3 and python2.7

tensorflow_gpu-1.10.0+nv18.10-cp27-cp27mu-linux_aarch64.whl
tensorflow_gpu-1.10.0+nv18.10-cp36-cp36m-linux_aarch64.whl

Following the tutorial, make is stopped with error, even if all seems to be ok.

Cannot wait to see solutions for porting this tutorial to Xavier.

Many thanks

My error is :

/tf_to_trt_image_classification/src/uff_to_plan.cpp: In function ‘int main(int, char**)’:
/tf_to_trt_image_classification/src/uff_to_plan.cpp:71:79: error: no matching function for call to ‘nvuffparser::IUffParser::registerInput(const char*, nvinfer1::DimsCHW)’
   parser->registerInput(inputName.c_str(), DimsCHW(3, inputHeight, inputWidth));
                                                                               ^
In file included from /tf_to_trt_image_classification/src/uff_to_plan.cpp:12:0:
/usr/include/aarch64-linux-gnu/NvUffParser.h:182:18: note: candidate: virtual bool nvuffparser::IUffParser::registerInput(const char*, nvinfer1::Dims, nvuffparser::UffInputOrder)
     virtual bool registerInput(const char* inputName, nvinfer1::Dims inputDims, UffInputOrder inputOrder) = 0;
                  ^
/usr/include/aarch64-linux-gnu/NvUffParser.h:182:18: note:   candidate expects 3 arguments, 2 provided
src/CMakeFiles/uff_to_plan.dir/build.make:62: recipe for target 'src/CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o' failed
make[2]: *** [src/CMakeFiles/uff_to_plan.dir/uff_to_plan.cpp.o] Error 1
CMakeFiles/Makefile2:160: recipe for target 'src/CMakeFiles/uff_to_plan.dir/all' failed
make[1]: *** [src/CMakeFiles/uff_to_plan.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Hi,

Please apply this change to make it compatible with TensorRT5.0:

diff --git a/src/uff_to_plan.cpp b/src/uff_to_plan.cpp
index ab2b395..fe7bf6c 100644
--- a/src/uff_to_plan.cpp
+++ b/src/uff_to_plan.cpp
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
   IBuilder *builder = createInferBuilder(gLogger);
   INetworkDefinition *network = builder->createNetwork();
   IUffParser *parser = createUffParser();
-  parser->registerInput(inputName.c_str(), DimsCHW(3, inputHeight, inputWidth));
+  parser->registerInput(inputName.c_str(), DimsCHW(3, inputHeight, inputWidth), UffInputOrder::kNCHW);
   parser->registerOutput(outputName.c_str());
   if (!parser->parse(uffFilename.c_str(), *network, dataType))
   {

Also, please make sure you have installed the required uff/graphsurgeon packages from here:

tar -xzf TensorRT-5.0.0.10.Ubuntu-18.04.1.x86_64-gnu.cuda-10.0.cudnn7.3.tar.gz
sudo pip install TensorRT-5.0.0.10/uff/uff-0.5.1-py2.py3-none-any.whl 
sudo pip install TensorRT-5.0.0.10/graphsurgeon/graphsurgeon-0.2.2-py2.py3-none-any.whl

Thanks.

1 Like

Well done !! thanks a lot!

So, conclusion, TENSORRT 5.0.0.10 is requiring a patch.

Is Nvidia going to republish the <> for Xavier or something more ?

Thanks