作为介绍,没有太多可说的:我想在TensorFlow中将LSTM堆叠在另一个LSTM上,但一直被我无法理解,更不用说单独解决的错误所阻止。
以下是代码:
def RNN(_X, _istate, _istate_2, _weights, _biases):
_X = tf.transpose(_X, [1, 0, 2])
_X = tf.reshape(_X, [-1, rozmiar_wejscia])
_X = tf.matmul(_X, _weights['hidden']) + _biases['hidden']
lstm_cell = rnn_cell.BasicLSTMCell(ukryta_warstwa, forget_bias=1.0)
_X = tf.split(0, liczba_krokow, _X)
outputs, states = rnn.rnn(lstm_cell, _X, initial_state=_istate)
lstm_cell_2 = rnn_cell.BasicLSTMCell(ukryta_warstwa, forget_bias = 1.0)
outputs2, states2 = rnn.rnn(lstm_cell_2, outputs, initial_state = _istate_2)
return tf.matmul(outputs2[-1], _weights['out']) + _biases['out']
我一直收到的是:
ValueError: Variable RNN/BasicLSTMCell/Linear/Matrix already exists, disallowed. Did you mean to set reuse=True in VarScope?
指向具有outputs2、states2的行
重置图表对解决问题没有丝毫帮助。如果需要其他信息来帮助解决问题,我将非常乐意提供。