cmusphinx / g2p-seq2seq

G2P with Tensorflow
Other
670 stars 194 forks source link

Running g2p interactive mode error: "AttributeError: 'HParams' object has no attribute 'problems'" #145

Closed wltz closed 6 years ago

wltz commented 6 years ago

Hi everyone,

I got an attributeError when running g2p in interactive mode, with pretrained model. Command: sudo g2p-seq2seq --interactive --model_dir g2p-seq2seq/g2p-seq2seq-model-6.2-cmudict-nostress/ Can anyone tell me what could the issue? Thanks!

Installed package version: g2p-seq2seq (6.2.1a0) tensor2tensor (1.6.6) tensorflow (1.9.0) numpy (1.15.0)

Following is the error message: **@Wukong_Laptop:~$ g2p-seq2seq --interactive --model_dir g2p-seq2seq/g2p-seq2seq-model-6.2-cmudict-nostress/ /home/**/.local/lib/python2.7/site-packages/h5py/init.py:36: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._conv import register_converters as _register_converters /home/**/.local/lib/python2.7/site-packages/h5py/init.py:45: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import h5a, h5d, h5ds, h5f, h5fd, h5g, h5r, h5s, h5t, h5p, h5z /home/**/.local/lib/python2.7/site-packages/h5py/_hl/group.py:22: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from .. import h5g, h5i, h5o, h5r, h5t, h5l, h5p /home/**/.local/lib/python2.7/site-packages/scipy/sparse/lil.py:19: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import _csparsetools /home/**/.local/lib/python2.7/site-packages/scipy/sparse/csgraph/init.py:165: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._shortest_path import shortest_path, floyd_warshall, dijkstra,\ /home/**/.local/lib/python2.7/site-packages/scipy/sparse/csgraph/_validation.py:5: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._tools import csgraph_to_dense, csgraph_from_dense,\ /home/**/.local/lib/python2.7/site-packages/scipy/sparse/csgraph/init.py:167: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._traversal import breadth_first_order, depth_first_order, \ /home/**/.local/lib/python2.7/site-packages/scipy/sparse/csgraph/init.py:169: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._min_spanning_tree import minimum_spanning_tree /home/**/.local/lib/python2.7/site-packages/scipy/sparse/csgraph/init.py:170: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._reordering import reverse_cuthill_mckee, maximum_bipartite_matching, \ /home/**/.local/lib/python2.7/site-packages/scipy/linalg/basic.py:17: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._solve_toeplitz import levinson /home/**/.local/lib/python2.7/site-packages/scipy/linalg/init.py:207: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._decomp_update import * /home/**/.local/lib/python2.7/site-packages/scipy/special/init.py:640: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._ufuncs import * /home/**/.local/lib/python2.7/site-packages/scipy/special/_ellip_harm.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm /home/**/.local/lib/python2.7/site-packages/scipy/interpolate/_bsplines.py:10: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import _bspl /home/**/.local/lib/python2.7/site-packages/scipy/spatial/init.py:95: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from .ckdtree import * /home/**/.local/lib/python2.7/site-packages/scipy/spatial/init.py:96: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from .qhull import * /home/**/.local/lib/python2.7/site-packages/scipy/spatial/_spherical_voronoi.py:18: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import _voronoi /home/**/.local/lib/python2.7/site-packages/scipy/spatial/distance.py:122: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import _hausdorff /home/**/.local/lib/python2.7/site-packages/scipy/ndimage/measurements.py:36: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import _ni_label /home/**/.local/lib/python2.7/site-packages/scipy/io/matlab/mio4.py:18: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from .mio_utils import squeeze_element, chars_to_strings /home/**/.local/lib/python2.7/site-packages/scipy/io/matlab/mio5.py:98: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from .mio5_utils import VarReader5 /home/**/.local/lib/python2.7/site-packages/scipy/signal/_max_len_seq.py:8: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._max_len_seq_inner import _max_len_seq_inner /home/**/.local/lib/python2.7/site-packages/scipy/signal/_upfirdn.py:36: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._upfirdn_apply import _output_len, _apply /home/**/.local/lib/python2.7/site-packages/scipy/optimize/_trlib/init.py:1: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._trlib import TRLIBQuadraticSubproblem /home/**/.local/lib/python2.7/site-packages/scipy/optimize/_numdiff.py:10: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._group_columns import group_dense, group_sparse /home/**/.local/lib/python2.7/site-packages/scipy/signal/spectral.py:10: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._spectral import _lombscargle /home/**/.local/lib/python2.7/site-packages/scipy/stats/_continuous_distns.py:18: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from . import _stats /home/**/.local/lib/python2.7/site-packages/scipy/signal/_peak_finding.py:13: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from ._peak_finding_utils import (_argmaxima1d, _select_by_peak_distance, INFO:tensorflow:Importing user module g2p_seq2seq from path /usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.1a0-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 WARNING:tensorflow:From /home/**/.local/lib/python2.7/site-packages/tensor2tensor/utils/trainer_lib.py:165: 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. INFO:tensorflow:schedule=continuous_train_and_eval INFO:tensorflow:worker_gpu=1 INFO:tensorflow:sync=False WARNING:tensorflow:Schedule=continuous_train_and_eval. 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 0x7fdc1bf84850>, '_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, '_device_fn': None, '_num_worker_replicas': 0, '_task_id': 0, '_log_step_count_steps': 100, '_evaluation_master': '', 't2t_device_info': {'num_async_replicas': 1}, '_num_ps_replicas': 0, '_train_distribute': None, '_is_chief': True, '_tf_config': gpu_options { per_process_gpu_memory_fraction: 1.0 } , '_save_checkpoints_steps': 409, '_environment': 'local', '_master': '', '_model_dir': 'g2p-seq2seq/g2p-seq2seq-model-6.2-cmudict-nostress/', 'data_parallelism': <tensor2tensor.utils.expert_utils.Parallelism object at 0x7fdc1bf84890>, '_save_summary_steps': 100} WARNING:tensorflow:Estimator's model_fn (<function wrapping_model_fn at 0x7fdc1bf85758>) 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.1a0', 'console_scripts', 'g2p-seq2seq')() File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.1a0-py2.7.egg/g2p_seq2seq/app.py", line 120, in main g2p_model.interactive() File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.1a0-py2.7.egg/g2p_seq2seq/g2p.py", line 265, in interactive self.prepare_interactive_model() File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.1a0-py2.7.egg/g2p_seq2seq/g2p.py", line 171, 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 968, 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 1074, in _call_input_fn return input_fn(kwargs) File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.1a0-py2.7.egg/g2p_seq2seq/g2p.py", line 140, in input_fn self.__interactive_input_fn()) File "/home/****/.local/lib/python2.7/site-packages/tensor2tensor/utils/decoding.py", line 385, in make_input_fn_from_generator first_ex = six.next(gen) File "/usr/local/lib/python2.7/dist-packages/g2p_seq2seq-6.2.1a0-py2.7.egg/g2p_seq2seq/g2p.py", line 233, in __interactive_input_fn p_hparams = self.hparams.problems[problem_id] AttributeError: 'HParams' object has no attribute 'problems'

nshmyrev commented 6 years ago

Just fixed, please update

wltz commented 6 years ago

Works well. Thanks!