yanwii / dynamic-seq2seq

seq2seq中文聊天机器人
336 stars 136 forks source link

ValueError: Attempt to reuse RNNCell #2

Closed skarl-api closed 7 years ago

skarl-api commented 7 years ago

出现如下错误,请帮忙解答:

ValueError: Attempt to reuse RNNCell <tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl.LSTMCell object at 0x0000000007E92E48> with a different variable scope than its first use. First use of cell was with scope 'BidirectionalEncoder/bidirectional_rnn/fw/lstm_cell', this attempt is with scope 'BidirectionalEncoder/bidirectional_rnn/bw/lstm_cell'. Please create a new instance of the cell if you would like it to use a different set of weights. If before you were using: MultiRNNCell([LSTMCell(...)] * numlayers), change to: MultiRNNCell([LSTMCell(...) for in range(num_layers)]). If before you were using the same cell instance as both the forward and reverse cell of a bidirectional RNN, simply create two instances (one for forward, one for reverse). In May 2017, we will start transitioning this cell's behavior to use existing stored weights, if any, when it is called with scope=None (which can lead to silent model degradation, so this error will remain until then.)

yanwii commented 7 years ago

建议先用tensorflow-1.0 最新的tensorflow有改动