When parsing a .uff file from tensorflow model , one issue confused me , about tf.reshape():
When I reshaped 2 tensors form (1,2,4,6) to (1,2,24), and add them, trt built the engine successfully
output_node_names = [“input”, “add”]
input = tf.placeholder(shape=[1,2,4,6],dtype=tf.float32, name=‘input’)
bias=tf.constant(value=1.0,shape=[1,2,4,6],dtype=tf.float32,name=‘bias’)
input=tf.reshape(input,shape=[1,2,24])
bias=tf.reshape(bias,shape=[1,2,24])
node name:add
output=input+bias
But reshaped from (1,2,4,6) to (1,2,4,3,2), it failed: Parameter check failed at: Network.cpp::addScale::175, condition: shift.count == 0 || shift.count == weightCount
output_node_names = [“input”, “add”]
input = tf.placeholder(shape=[1,2,4,6],dtype=tf.float32, name=‘input’)
bias=tf.constant(value=1.0,shape=[1,2,4,6],dtype=tf.float32,name=‘bias’)
input=tf.reshape(input,shape=[1,2,4,3,2])
bias=tf.reshape(bias,shape=[1,2,4,3,2])
node name:add
output=input+bias
It seemed not supported to add two tensors reshaped from less dimensions?
win10
trt 5.1.5.0
cuda 10.0
cudnn 7.3.1