Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Attempt to reuse RNNCell #34

Closed
Denisolt opened this issue Apr 25, 2017 · 3 comments
Closed

ValueError: Attempt to reuse RNNCell #34

Denisolt opened this issue Apr 25, 2017 · 3 comments

Comments

@Denisolt
Copy link

After editing the seq2seq_model.py file. I changed cells values from tf.rnn to tf.contrib.rnn and etc.
Now I am getting this error:

ValueError: Attempt to reuse RNNCell <tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl.GRUCell object at 0x11b9f5790> with a different variable scope than its first use. First use of cell was with scope 'embedding_attention_seq2seq/rnn/multi_rnn_cell/cell_0/gru_cell', this attempt is with scope 'embedding_attention_seq2seq/rnn/multi_rnn_cell/cell_1/gru_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([GRUCell(...)] * num_layers), change to: MultiRNNCell([GRUCell(...) 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.)

Any idea?
thank you in advance

@Arka161
Copy link

Arka161 commented Apr 30, 2017

I've the same error.
It doesn't fix ever after using their documented code

@jonsanti
Copy link

jonsanti commented May 3, 2017

I have the same error as well. Any info on fixes?

@Denisolt
Copy link
Author

Denisolt commented May 5, 2017

@Arka161 @jonsanti
Found a simple solution:

  • Set up a virtual environment
virtualenv local
cd local/bin/activate
  • Install Tensorflow 0.12
pip install tensorflow==0.12

Also make sure, that you edit the seq2seq_model.py back to original

if anything, text me directly I guess.
Telegram: @denishakh
Email: denisolt@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants