I coded an instance norm layer, which include a tf.sqrt opperation.

def instance_norm(x, n_features):

with tf.variable_scope(‘instance_norm’) as scope:

gama = tf.Variable(tf.ones([n_features]),name=“gama”)

beta = tf.Variable(tf.zeros([n_features]), name=“beta”)

epsilon = 1e-3

mean = tf.reduce_mean(x, [1,2], keep_dims=True)

var = tf.reduce_mean(tf.multiply(tf.substract(x,mean), tf.substract(x, mean)), [1,2], keep_dims=True)

norm = tf.div(tf.subtract(x,mean), tf.sqrt(tf.add(var, epsilon)))

return gama * norm + beta

tensorrt raised errors

[TensorRT] ERROR: UFFParser: Parser error: generator/dmux1/instance_norm/Sqrt: Unary not supported for other non-constant node

Ubuntu 16.04

cuda 9.0 cudnn 7.1.3

tensorflow-gpu 1.10

python 2.7

tensorRT 4.0.1.6