我想定义一个多层LSTM_cell,需要对每层输出增加一个BN层和激活函数,代码如下:
def get_lstm_cell(rnn_size,keep_prob):
lstm_cell = tf.contrib.rnn.LSTMCell(rnn_size,
initializer=tf.truncated_normal_initializer(stddev=0.1,seed=2))
lstm_cell = tf.layers.batch_normalization(lstm_cell,training=True) #这种写法是错的,要怎么改?
lstm_cell = tf.relu(lstm_cell)
return lstm_cell
实际运行会报错,提示:('Input has undefined rank:', TensorShape(None))
该怎么解决呢