cmusphinx / g2p-seq2seq

G2P with Tensorflow
Other
670 stars 194 forks source link

Error in starting the interactive session #107

Closed mausamsion closed 6 years ago

mausamsion commented 6 years ago

$ g2p-seq2seq --interactive --model_dir g2p-seq2seq-cmudict

from ._conv import register_converters as _register_converters Traceback (most recent call last): File "~/anaconda2/bin/g2p-seq2seq", line 11, in <module> load_entry_point('g2p-seq2seq==6.0.0a0', 'console_scripts', 'g2p-seq2seq')() File "~/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "~/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point return ep.load() File "~/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2408, in load return self.resolve() File "~/anaconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2414, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "~/anaconda2/lib/python2.7/site-packages/g2p_seq2seq-6.0.0a0-py2.7.egg/g2p_seq2seq/__init__.py", line 24, in <module> from g2p_seq2seq import app File "~/anaconda2/lib/python2.7/site-packages/g2p_seq2seq-6.0.0a0-py2.7.egg/g2p_seq2seq/app.py", line 31, in <module> from g2p_seq2seq.g2p import G2PModel File "~/anaconda2/lib/python2.7/site-packages/g2p_seq2seq-6.0.0a0-py2.7.egg/g2p_seq2seq/g2p.py", line 30, in <module> from g2p_seq2seq import g2p_trainer_utils File "~/anaconda2/lib/python2.7/site-packages/g2p_seq2seq-6.0.0a0-py2.7.egg/g2p_seq2seq/g2p_trainer_utils.py", line 26, in <module> from tensor2tensor.utils import input_fn_builder ImportError: cannot import name input_fn_builder

I have tensorflow version 1.4.1 and tensor2tensor version 1.5.5 installed.

nurtas-m commented 6 years ago

Thank you for the report! This bug appears with tensor2tensor versions higher than 1.3.2. We will try to fix it in next release.

michem32 commented 6 years ago

Class 'g2p_trainer_utils.py' tries to import the following classes from 'tensor2tensor.utils':

I managed to find them in a previous version, for example here: https://github.com/tensorflow/tensor2tensor/tree/9a651716367308fe55820dc37578371e177e5d91/tensor2tensor/utils

But, I don't know how stable they are.

Any update on that?

nurtas-m commented 6 years ago

Yes, there are a lot of changes in tensor2tensor starting from version 1.4.0. Now I am trying to modify our code in order to g2p_seq2seq work with the new tensor2tensor.

nshmyrev commented 6 years ago

@nurtas-m is this fixed already?

nurtas-m commented 6 years ago

Fixed partially. We need to upload new pre-trained models.

nurtas-m commented 6 years ago

Fixed with commit 762de8f57eb74bccaa3a9239f4782ab4de44af84

AshishDagar commented 6 years ago

I am trying to run _g2p-seq2seq --interactive --model_dir g2p-seq2seq-cmudict_ command but getting below error. Installed g2p-seq2seq from pip command. Can anyone help, I am not sure what to do next.

Traceback (most recent call last): File "/root/miniconda2/bin/g2p-seq2seq", line 7, in from g2p_seq2seq.app import main File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/init.py", line 24, in from g2p_seq2seq import app File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/app.py", line 31, in from g2p_seq2seq.g2p import G2PModel File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/g2p.py", line 28, in from g2p_seq2seq import g2p_trainer_utils File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/g2p_trainer_utils.py", line 26, in from tensor2tensor.utils import input_fn_builder ImportError: cannot import name input_fn_builder

nurtas-m commented 6 years ago

Hello, @AshishDagar Install g2p-seq2seq from github, please. Also, current version of g2p-seq2seq toolkit requires tensor2tensor ver=1.5.7.

AshishDagar commented 6 years ago

Hello, @nurtas-m

I tried what you said. Even test was OK. But still interactive session is not opening :

Test Run :

running test running egg_info writing entry points to g2p_seq2seq.egg-info/entry_points.txt writing requirements to g2p_seq2seq.egg-info/requires.txt writing g2p_seq2seq.egg-info/PKG-INFO writing dependency_links to g2p_seq2seq.egg-info/dependency_links.txt writing top-level names to g2p_seq2seq.egg-info/top_level.txt reading manifest file 'g2p_seq2seq.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'g2p_seq2seq.egg-info/SOURCES.txt' running build_ext test_decode (tests.g2p_unittest.TestG2P) ... /home/ashishdagar/g2p-seq2seq/g2p_seq2seq/g2p_trainer_utils.py:210: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/ashishdagar/g2p-seq2seq/tests/models/decode/model.params' mode='r' encoding='UTF-8'> model_params = json.load(open(params_file_path)) WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensor2tensor/utils/trainer_lib.py:144: RunConfig.init (from tensorflow.contrib.learn.python.learn.estimators.run_config) is deprecated and will be removed in a future version. Instructions for updating: When switching to tf.estimator.Estimator, use tf.estimator.RunConfig instead. [2018-06-11 17:11:43,397] From /usr/local/lib/python3.5/dist-packages/tensor2tensor/utils/trainer_lib.py:144: RunConfig.init (from tensorflow.contrib.learn.python.learn.estimators.run_config) is deprecated and will be removed in a future version. Instructions for updating: When switching to tf.estimator.Estimator, use tf.estimator.RunConfig instead. /usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/tf_logging.py:121: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead _get_logger().warn(msg, *args, **kwargs) WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine. [2018-06-11 17:11:43,397] Schedule=train_and_evaluate. Assuming that training is running on a single machine. WARNING:tensorflow:Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9071fab70>) includes params argument, but params are not passed to Estimator. [2018-06-11 17:11:43,398] Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9071fab70>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/monitors.py:279: BaseMonitor.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. [2018-06-11 17:11:43,399] From /usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/monitors.py:279: BaseMonitor.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. WARNING:tensorflow:From /home/ashishdagar/g2p-seq2seq/g2p_seq2seq/g2p_trainer_utils.py:157: Experiment.init (from tensorflow.contrib.learn.python.learn.experiment) is deprecated and will be removed in a future version. Instructions for updating: Please switch to tf.estimator.train_and_evaluate. You will also have to convert to a tf.estimator.Estimator. [2018-06-11 17:11:43,400] From /home/ashishdagar/g2p-seq2seq/g2p_seq2seq/g2p_trainer_utils.py:157: Experiment.init (from tensorflow.contrib.learn.python.learn.experiment) is deprecated and will be removed in a future version. Instructions for updating: Please switch to tf.estimator.train_and_evaluate. You will also have to convert to a tf.estimator.Estimator. WARNING:tensorflow:Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9071a7c80>) includes params argument, but params are not passed to Estimator. [2018-06-11 17:11:43,401] Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9071a7c80>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:Input graph does not use tf.data.Dataset or contain a QueueRunner. That means predict yields forever. This is probably a mistake. [2018-06-11 17:11:43,526] Input graph does not use tf.data.Dataset or contain a QueueRunner. That means predict yields forever. This is probably a mistake. /usr/local/lib/python3.5/dist-packages/tensorflow/python/util/tf_inspect.py:55: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead if d.decorator_argspec is not None), _inspect.getargspec(target)) WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensor2tensor/layers/common_layers.py:600: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead [2018-06-11 17:11:43,825] From /usr/local/lib/python3.5/dist-packages/tensor2tensor/layers/common_layers.py:600: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensor2tensor/utils/beam_search.py:93: calling reduce_logsumexp (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead [2018-06-11 17:11:45,010] From /usr/local/lib/python3.5/dist-packages/tensor2tensor/utils/beam_search.py:93: calling reduce_logsumexp (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead 2018-06-11 17:11:45.204550: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-06-11 17:11:45.292719: E tensorflow/stream_executor/cuda/cuda_driver.cc:406] failed call to cuInit: CUDA_ERROR_UNKNOWN 2018-06-11 17:11:45.292779: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:145] kernel driver does not appear to be running on this host (197NODDT13048): /proc/driver/nvidia/version does not exist /home/ashishdagar/g2p-seq2seq/tests/g2p_unittest.py:36: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/ashishdagar/g2p-seq2seq/tests/models/decode/decode_output.txt' mode='r' encoding='UTF-8'> out_lines = open(output_file_path).readlines() ok test_evaluate (tests.g2p_unittest.TestG2P) ... WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine. [2018-06-11 17:11:45,781] Schedule=train_and_evaluate. Assuming that training is running on a single machine. WARNING:tensorflow:Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9767ab950>) includes params argument, but params are not passed to Estimator. [2018-06-11 17:11:45,781] Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9767ab950>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9767abae8>) includes params argument, but params are not passed to Estimator. [2018-06-11 17:11:45,782] Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff9767abae8>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:Input graph does not use tf.data.Dataset or contain a QueueRunner. That means predict yields forever. This is probably a mistake. [2018-06-11 17:11:45,808] Input graph does not use tf.data.Dataset or contain a QueueRunner. That means predict yields forever. This is probably a mistake. Words: 3 Errors: 3 WER: 1.000 Accuracy: 0.000 WARNING:tensorflow:Input graph does not use tf.data.Dataset or contain a QueueRunner. That means predict yields forever. This is probably a mistake. [2018-06-11 17:11:47,984] Input graph does not use tf.data.Dataset or contain a QueueRunner. That means predict yields forever. This is probably a mistake. ok test_train (tests.g2p_unittest.TestG2P) ... WARNING:tensorflow:Schedule=train_and_evaluate. Assuming that training is running on a single machine. [2018-06-11 17:11:50,158] Schedule=train_and_evaluate. Assuming that training is running on a single machine. WARNING:tensorflow:Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff976c45400>) includes params argument, but params are not passed to Estimator. [2018-06-11 17:11:50,159] Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff976c45400>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff976c45730>) includes params argument, but params are not passed to Estimator. [2018-06-11 17:11:50,159] Estimator's model_fn (<function T2TModel.make_estimator_model_fn..wrapping_model_fn at 0x7ff976c45730>) includes params argument, but params are not passed to Estimator. WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensor2tensor/layers/common_layers.py:1828: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

[2018-06-11 17:11:51,778] From /usr/local/lib/python3.5/dist-packages/tensor2tensor/layers/common_layers.py:1828: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gradientsimpl.py:100: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " /usr/local/lib/python3.5/dist-packages/tensor2tensor/utils/metrics.py:392: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead args, , keywords, _ = inspect.getargspec(metric_fn) ok


Ran 3 tests in 37.001s

OK

Interactive Session Run :

root@197NODDT13048:/home/ashishdagar/g2p-seq2seq# g2p-seq2seq --interactive --model g2p-seq2seq-cmudict Traceback (most recent call last): File "/root/miniconda2/bin/g2p-seq2seq", line 7, in from g2p_seq2seq.app import main File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/init.py", line 24, in from g2p_seq2seq import app File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/app.py", line 31, in from g2p_seq2seq.g2p import G2PModel File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/g2p.py", line 28, in from g2p_seq2seq import g2p_trainer_utils File "/root/miniconda2/lib/python2.7/site-packages/g2p_seq2seq/g2p_trainer_utils.py", line 26, in from tensor2tensor.utils import input_fn_builder ImportError: cannot import name input_fn_builder

nurtas-m commented 6 years ago

Ok, as I understand from the logs, you had launched:

The problem is that you had installed another version of tensor2tensor (not 1.5.7) for python2.7

AshishDagar commented 6 years ago

@nurtas-m

Now working fine after installing tensor2tensor version 1.5.7. Thanks..!!!!

nurtas-m commented 6 years ago

@AshishDagar You welcome))