cmusphinx / g2p-seq2seq

G2P with Tensorflow
Other
667 stars 196 forks source link

AttributeError: 'HParams' object has no attribute 'input_modality' tensorflow 1.13 and python 3.6 #170

Closed cindy951357 closed 4 years ago

cindy951357 commented 5 years ago

g2p-seq2seq: 6.2.2a0 python: 3.6.5 tensorflow: 1.13 tensor2tensor: 1.12

I run this on my Mac:

g2p-seq2seq --model_dir=/Users/cindy/Documents/pythonworkspace/sphinxenv/g2p-seq2seq-model-6.2-cmudict-nostress --interactive

Then I get:

Traceback (most recent call last): File "/usr/local/bin/g2p-seq2seq", line 11, in load_entry_point('g2p-seq2seq==6.2.2a0', 'console_scripts', 'g2p-seq2seq')() File "/usr/local/lib/python3.6/site-packages/g2p_seq2seq-6.2.2a0-py3.6.egg/g2p_seq2seq/app.py", line 123, in main g2p_model.interactive() File "/usr/local/lib/python3.6/site-packages/g2p_seq2seq-6.2.2a0-py3.6.egg/g2p_seq2seq/g2p.py", line 264, in interactive self.prepare_interactive_model() File "/usr/local/lib/python3.6/site-packages/g2p_seq2seq-6.2.2a0-py3.6.egg/g2p_seq2seq/g2p.py", line 171, in prepare_interactive_model input_fn, estimator_lib.model_fn_lib.ModeKeys.PREDICT) File "/usr/local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1026, in _get_features_from_input_fn result = self._call_input_fn(input_fn, mode) File "/usr/local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1138, in _call_input_fn return input_fn(**kwargs) File "/usr/local/lib/python3.6/site-packages/g2p_seq2seq-6.2.2a0-py3.6.egg/g2p_seq2seq/g2p.py", line 140, in input_fn self.__interactive_input_fn()) File "/usr/local/lib/python3.6/site-packages/tensor2tensor-1.12.0-py3.6.egg/tensor2tensor/utils/decoding.py", line 553, in make_input_fn_from_generator first_ex = six.next(gen) File "/usr/local/lib/python3.6/site-packages/g2p_seq2seq-6.2.2a0-py3.6.egg/g2p_seq2seq/g2p.py", line 233, in __interactive_input_fn has_input = "inputs" in p_hparams.input_modality AttributeError: 'HParams' object has no attribute 'input_modality'

What went wrong? Thanks!

nshmyrev commented 4 years ago

Same as https://github.com/cmusphinx/g2p-seq2seq/issues/155. You need specific tensorflow and tensor2tensor versions