create_inference_graph does not take input_saved_model_dirs and input_saved_model_tags as parameters

Hello,

I am using Jetson TX2 with JetPack 3.3, Tensorflow 1.11.0, libnvinfer 4.1.3, Cuda 9.0.
I am trying to create_inference_graph using my saved keras model using the trt.create_inference_graph function according to this tutorial: https://docs.nvidia.com/deeplearning/frameworks/tf-trt-user-guide/index.html#using-savedmodel
I have imported trt as:
import tensorflow.contrib.tensorrt as trt

As per most of the imports, “from tensorflow.python.compiler.tensorrt import trt_convert” is not available and hence I use “import tensorflow.contrib.tensorrt as trt”

However, I get an error saying: “TypeError: create_inference_graph() got an unexpected keyword argument ‘input_saved_model_dir’”

When I check the trt_convert.py located at":/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/tensorrt/python/, the function definition itself does not take the “input_saved_model_dir”, “input_saved_model_tags” parameters as input: The function from the trt_convert.py is as below:

def create_inference_graph(input_graph_def,
outputs,
max_batch_size=1,
max_workspace_size_bytes=2 << 20,
precision_mode=“FP32”,
minimum_segment_size=3,
is_dynamic_op=False,
maximum_cached_engines=1,
cached_engine_batches=None):

This definition is different the one found here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/compiler/tensorrt/trt_convert.py

I am not sure what I am missing here. Is it that the version of tensorrt is not updated?

Appreciate some help!

Hi,

The API has changed from TensorRT 5.0.
I’m not sure if it is compatible to the TensorFlow package you used.

Is any special reason to use JetPack3.3?
We have a newer JetPack4.2 to support Jetson TX2.
It’s recommended to give it a try.

Thanks.

I tried installing the newer JetPack 4.2 but the installations were not going through the GUI. I figured the .run installer was much easier (Although it had its own issues, but still I could move ahead with it.)
From what you are saying I might have to flash a new jetpack version. Do I have to uninstall the older version in some way? Is there a .run installer available for JetPack 4.2 too?

So I tried my luck again with JetPack 4.2. This time I achieved better success than the last time, however there are still some issues:

  1. While downloading and installing on Host (Ubuntu 16.04) the installation fails for CUDA Cross Compiler with error: Check the orange underlined line (deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ xenial multiverse)

15:35:04 ERROR : CUDA Cross Compile Package on Host : E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-arm64/Packages 404 Not Found [IP: 91.189.91.23 80]
15:35:05 ERROR : CUDA Cross Compile Package on Host : E: Unable to correct problems, you have held broken packages.
15:35:05 ERROR : CUDA Cross Compile Package on Host : NV_CUDA_HOST_CROSS_COMP apt install failed
15:35:05 ERROR : CUDA Cross Compile Package on Host : command terminated with error

My source.list located at /etc/apt looks like this:

deb cdrom:[Ubuntu 16.04.5 LTS Xenial Xerus - Release amd64 (20180731)]/ xenial main restricted

See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

newer versions of the distribution.

deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

Major bug fix updates produced after the final release of the

distribution.

deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team. Also, please note that software in universe WILL NOT receive any

review or updates from the Ubuntu security team.

deb http://us.archive.ubuntu.com/ubuntu/ xenial universe

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe

deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team, and may not be under a free licence. Please satisfy yourself as to

your rights to use the software. Also, please note that software in

multiverse WILL NOT receive any review or updates from the Ubuntu

security team.

deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ xenial multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse

deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

N.B. software from this repository may not have been tested as

extensively as that contained in the main release, although it includes

newer versions of some applications which may provide useful features.

Also, please note that software in backports WILL NOT receive any review

or updates from the Ubuntu security team.

deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

Uncomment the following two lines to add software from Canonical’s

‘partner’ repository.

This software is not part of Ubuntu, but is offered by Canonical and the

respective vendors as a service to Ubuntu users.

deb http://archive.canonical.com/ubuntu xenial partner

deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted

deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted

deb http://security.ubuntu.com/ubuntu xenial-security universe

deb-src http://security.ubuntu.com/ubuntu xenial-security universe

deb http://security.ubuntu.com/ubuntu xenial-security multiverse

deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

However target installation and flashing completes successfully.
2. When I see the target screen, I cannot find any installed files and folders. Like tegra_multimedia_api, visionworks samples, etc,. which I found when I installed jetpack 3.3 successfully.

I am not sure where I am going wrong. Really appreciate your help!
Thank you!

Hi,

It looks like there is some issue in installing the package on the host.
This is related to GPU card, GPU driver, CUDA, Ubuntu version, … on the host, which is pretty complicated.

To get JetPack4.2, you can just uncheck the host item and try it again.

Thanks.

Hello AastaLL,

JetPack 4.2 worked well. I had issues with CUDA Compiler on host, but target flashed successfully. I was not able to find the tegra_multimedia_api and other CUDA samples in the Home directory (JetPack 3.3 installed these in the Home directory, so when I didn’t see the particular folders mentioned above in the Home directory I thought something might have gone wrong). But later found them here: /usr/src/

Thank you!