Closed loretoparisi closed 6 years ago
[UPDATE]
It seems now that the pre-trained model is broken for TF 1.1 as well:
Creating 2 layers of 512 units.
Traceback (most recent call last):
File "/usr/local/bin/g2p-seq2seq", line 11, in <module>
load_entry_point('g2p-seq2seq==5.0.0a0', 'console_scripts', 'g2p-seq2seq')()
File "build/bdist.linux-x86_64/egg/g2p_seq2seq/app.py", line 92, in main
File "build/bdist.linux-x86_64/egg/g2p_seq2seq/g2p.py", line 101, in load_decode_model
File "build/bdist.linux-x86_64/egg/g2p_seq2seq/seq2seq_model.py", line 164, in __init__
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1201, in model_with_buckets
decoder_inputs[:bucket[1]])
File "build/bdist.linux-x86_64/egg/g2p_seq2seq/seq2seq_model.py", line 163, in <lambda>
File "build/bdist.linux-x86_64/egg/g2p_seq2seq/seq2seq_model.py", line 140, in seq2seq_f
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 855, in embedding_attention_seq2seq
encoder_cell, encoder_inputs, dtype=dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 197, in static_rnn
(output, state) = call_cell()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 184, in <lambda>
call_cell = lambda: cell(input_, state)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 881, in __call__
return self._cell(embedded, state)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 953, in __call__
cur_inp, new_state = cell(cur_inp, cur_state)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 146, in __call__
with _checked_scope(self, scope or "gru_cell", reuse=self._reuse):
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 77, in _checked_scope
type(cell).__name__))
ValueError: Attempt to reuse RNNCell <tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl.GRUCell object at 0x7f70be2d3750> 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.)
@loretoparisi the TF version is changed, you should retrain the model. Try from training and then run interactive mode.
@lifefeel thanks! I'm now training with TF 1.5.0. Do you think that latest TF 1.6 gpu would work as well?
@roeeaharoni you just have to download the CMU dictionary and run on it, see here for the link: https://github.com/cmusphinx/g2p-seq2seq#training-g2p-system
Works, thanks!
Closing this since it was basically solved!
@loretoparisi I'm using TF 1.6.0 and works well.
I have installed TF 1.5.0 since the latest merge seems to work with TF 1.4 and 1.5, while I get this error when running
g2p-seq2seq --interactive --model g2p-seq2seq-cmudict
I have the model installed locally: