cmusphinx / g2p-seq2seq

G2P with Tensorflow
Other
669 stars 195 forks source link

Error in starting interactive session in g2p-seq2seq #132

Closed krutika23 closed 6 years ago

krutika23 commented 6 years ago

Hi, I installed g2p using setup.py but while running the interactive command: /usr/local/bin/g2p-seq2seq --interactive --model_dir g2pdict i am getting the following error

INFO:tensorflow:Importing user module g2p_seq2seq from path /usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.0a0-py2.7.egg INFO:tensorflow:Overriding hparams in transformer_base with num_hidden_layers=3,filter_size=512,batch_size=4096,length_bucket_step=1.5,num_heads=4,max_length=30,eval_drop_long_sequences=1,hidden_size=256,min_length_bucket=6 INFO:tensorflow:schedule=train_and_evaluate INFO:tensorflow:worker_gpu=1 INFO:tensorflow:sync=False WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine. INFO:tensorflow:datashard_devices: ['gpu:0'] INFO:tensorflow:caching_devices: None INFO:tensorflow:ps_devices: ['gpu:0'] INFO:tensorflow:Using config: {'_save_checkpoints_secs': None, '_keep_checkpoint_max': 1, '_task_type': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f1316b8c310>, '_keep_checkpoint_every_n_hours': 1, '_session_config': gpu_options { per_process_gpu_memory_fraction: 0.95 } allow_soft_placement: true graph_options { optimizer_options { } } , 'use_tpu': False, '_tf_random_seed': None, '_num_worker_replicas': 0, '_task_id': 0, 't2t_device_info': {'num_async_replicas': 1}, '_evaluation_master': '', '_log_step_count_steps': 100, '_num_ps_replicas': 0, '_is_chief': True, '_tf_config': gpu_options { per_process_gpu_memory_fraction: 1.0 } , '_save_checkpoints_steps': 409, '_environment': 'local', '_master': '', '_model_dir': 'g2pdict', 'data_parallelism': <tensor2tensor.utils.expert_utils.Parallelism object at 0x7f1316b8c390>, '_save_summary_steps': 100} WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7f12fd9faaa0>) includes params argument, but params are not passed to Estimator. INFO:tensorflow:Using ValidationMonitor WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/monitors.py:267: init (from tensorflow.contrib.learn.python.learn.monitors) is deprecated and will be removed after 2016-12-05. Instructions for updating: Monitors are deprecated. Please use tf.train.SessionRunHook. INFO:tensorflow:Using config: {'_save_checkpoints_secs': None, '_keep_checkpoint_max': 1, '_task_type': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f1316b8c310>, '_keep_checkpoint_every_n_hours': 1, '_session_config': gpu_options { per_process_gpu_memory_fraction: 0.95 } allow_soft_placement: true graph_options { optimizer_options { } } , 'use_tpu': False, '_tf_random_seed': None, '_num_worker_replicas': 0, '_task_id': 0, 't2t_device_info': {'num_async_replicas': 1}, '_evaluation_master': '', '_log_step_count_steps': 100, '_num_ps_replicas': 0, '_is_chief': True, '_tf_config': gpu_options { per_process_gpu_memory_fraction: 1.0 } , '_save_checkpoints_steps': 409, '_environment': 'local', '_master': '', '_model_dir': 'g2pdict', 'data_parallelism': <tensor2tensor.utils.expert_utils.Parallelism object at 0x7f1316b8c390>, '_save_summary_steps': 100} WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7f12fd92c9b0>) includes params argument, but params are not passed to Estimator. Traceback (most recent call last): File "/usr/local/bin/g2p-seq2seq", line 11, in load_entry_point('g2p-seq2seq==6.2.0a0', 'console_scripts', 'g2p-seq2seq')() File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.0a0-py2.7.egg/g2p_seq2seq/app.py", line 118, in main g2p_model.interactive() File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.0a0-py2.7.egg/g2p_seq2seq/g2p.py", line 260, in interactive self.prepare_interactive_model() File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.0a0-py2.7.egg/g2p_seq2seq/g2p.py", line 167, in prepare_interactive_model input_fn, estimator_lib.model_fn_lib.ModeKeys.PREDICT) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 585, in _get_features_from_input_fn result = self._call_input_fn(input_fn, mode) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 694, in _call_input_fn return input_fn(**kwargs) File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.0a0-py2.7.egg/g2p_seq2seq/g2p.py", line 139, in input_fn example, self.hparams) File "/usr/local/lib/python2.7/dist-packages/tensor2tensor-1.6.3-py2.7.egg/tensor2tensor/utils/decoding.py", line 583, in _interactive_input_tensor_to_features_dict p_hparams = hparams.problem_hparams AttributeError: 'HParams' object has no attribute 'problem_hparams'

i have installed python 2.7 tensorflow-1.5.0 g2p_seq2seq-6.2.0a0 tensor2tensor-1.6.3 on ubuntu 18.04 OS , can you tell me what is the issue?

maxisawesome commented 6 years ago

Pretty sure they only support up to tensor2tensor version 1.5.7. I had this error at some point and I think downgrading was what solved it.... it was either that or reinstalling tensorflow did it.

omenlabs commented 6 years ago

I had the same problem. Following the suggestion from @maxisawesome, this got me going (in case you aren't familiar with pip):

pip install tensor2tensor==1.5.7

wltz commented 6 years ago

I've downgrade tensor2tensor to 1.5.7, still got the same error. Anybody knows what's the issue? Thanks! Current installation: Python 2.7.12 tensorflow 1.9.0 tensor2tensor 1.5.7 g2p-seq2seq 6.2.1a0

nshmyrev commented 6 years ago

@wltz 1.5.7 is not required anymore, it should work with 1.6.2. Provide the output with latest github checkout.

nishant260190 commented 6 years ago

Yes this error because of the tensorflow version support. I've downgrade tensorflow to 1.5.7 than it gives an error of minimum support version is 1.6.6 so I have upgraded it to 1.6.6 and it works fine after that.