TensorRT 5.1.2.2 and GPU Gtx-1080Ti
when I use add_scale to implement batch nomalization layer , i get this error. how this happend and how to solve it. following is my code
g0 = params[‘batch_normalization_1/gamma:0’].reshape(-1)
m0 = params[‘batch_normalization_1/moving_mean:0’].reshape(-1)
v0 = params[‘batch_normalization_1/moving_variance:0’].reshape(-1)
scale0 = g0 / np.sqrt(v0 + 1e-3)
shift0 = -m0 / np.sqrt(v0 + 1e-3) * g0 + params['batch_normalization_1/beta:0'].reshape(-1)
power0 = np.ones(len(g0), dtype=np.float32)
bag += [scale0, shift0, power0]
batch_norm_layer = network.add_scale(lstm_encode.get_output(0), trt.ScaleMode.CHANNEL,
shift0, scale0, power0)