Error when using tf.concat while parsing to plan on jetson TX2

hi,
we are working on jetson TX2
jetpack 3.2.1

We are getting an error when parsing uff to plan

Our net architecture used tf.concat between tf.palceholder and a tf.contant:

y = tf.placeholder(‘float32’,shape=[1,1,1024, 1280],name=‘input_0’)
phi = tf.constant(value=1,shape=[1,3,1024, 1280],dtype=‘float32’, name=‘phi’)

y_concat = tf.concat([y,phi],1,name=“concat”) #concatanate phi to the input for 4 channel tensor

filter = tf.Variable(tf.random_normal([3,3,4,1], stddev=0.35),name=“f”)

conv = tf.nn.conv2d(y_concat,f,[1,1,1,1],padding=“SAME”,data_format=“NCHW”,name=“output_0”)

save to uff

OUTPUT_NAMES=[“output_0”]
graphdef = graph.as_graph_def()

frozen_graph = tf.graph_util.convert_variables_to_constants(sess, graphdef, OUTPUT_NAMES)
uff.from_tensorflow(graphdef=frozen_graph,
output_filename=UFF_OUTPUT_FILENAME,
output_nodes=OUTPUT_NAMES,
text=True)

When parsing on jetson:

parser->registerInput(InputName.c, DimsCHW(1,1024,1280))

we get an error:

output_0: kernel weights has count 36 but 9 was expected

it looks like it filter just the input (not use the concat operation)

Hi,

It is recommended to use NHWC format instead of NCHW.
Is it possible for your use case?

For example,
[url]https://devtalk.nvidia.com/default/topic/1037062/jetson-tx2/tensorrt-input-concatenation-example/post/5268765/#5268765[/url]

Thanks.

hi,
Thanks for the quick reply

From the tensorrt developer guide:

Note:TensorRT expects the input tensor be in CHW order. When importing from TensorFlow, ensure that the input tensor is in the required order, and if not, convert it to CHW.

Furthermore, we first tried NHWC and got the kernel weights error more confusing

The difference from the example is that we try to concat between one input(placeholder) and a constant

Thanks in advance

Hi,

We can reproduce this issue and will feedback to our internal team.
Currently, could you create a input layer and feed the constant via register_input as a workaround?

Thanks.

Hi,

yes,
For now, we feeds the constant through the input layer

thank you