cmusphinx/g2p-seq2seq

Issue running g2p-seq2seq after install

TristanKnot opened this issue · 3 comments

I'm having issues running the g2p model after setting up the package with sudo python setup.py install.
When I run the following in terminal I get the error below:

"g2p-seq2seq --interactive --model_dir ../../test_model/g2p-seq2seq-model-6.2-cmudict-nostress/ "
or simply
"g2p-seq2seq"

I have TensorFlow (1.15) and t2t installed.
"/usr/local/bin" is in my PATH and "g2p..." tab completes when I try to execute the script, but I still get the error below.
I'm running this on macOS.

Did I need to take any additional steps that are not outlined in the README?

tek:g2p_seq2seq Tristan$ g2p-seq2seq
Traceback (most recent call last):
File "/Users/Tristan/anaconda3/bin/g2p-seq2seq", line 33, in
sys.exit(load_entry_point('g2p-seq2seq==6.2.2a0', 'console_scripts', 'g2p-seq2seq')())
File "/Users/Tristan/anaconda3/bin/g2p-seq2seq", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/Users/Tristan/anaconda3/lib/python3.7/site-packages/importlib_metadata/api.py", line 310, in distribution
return Distribution.from_name(package)
File "/Users/Tristan/anaconda3/lib/python3.7/site-packages/importlib_metadata/api.py", line 158, in from_name
raise PackageNotFoundError(name)
importlib_metadata.api.PackageNotFoundError: g2p-seq2seq

Here is the output from my setup.py install

running install
running bdist_egg
running egg_info
writing g2p_seq2seq.egg-info/PKG-INFO
writing dependency_links to g2p_seq2seq.egg-info/dependency_links.txt
writing entry points to g2p_seq2seq.egg-info/entry_points.txt
writing requirements to g2p_seq2seq.egg-info/requires.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'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.7-x86_64/egg
creating build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/g2p_trainer_utils.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/params.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/g2p_encoder.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/__init__.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/app.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/g2p.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
copying build/lib/g2p_seq2seq/g2p_problem.py -> build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/g2p_trainer_utils.py to g2p_trainer_utils.cpython-37.pyc
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/params.py to params.cpython-37.pyc
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/g2p_encoder.py to g2p_encoder.cpython-37.pyc
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/app.py to app.cpython-37.pyc
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/g2p.py to g2p.cpython-37.pyc
byte-compiling build/bdist.macosx-10.7-x86_64/egg/g2p_seq2seq/g2p_problem.py to g2p_problem.cpython-37.pyc
creating build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
copying g2p_seq2seq.egg-info/PKG-INFO -> build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
copying g2p_seq2seq.egg-info/SOURCES.txt -> build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
copying g2p_seq2seq.egg-info/dependency_links.txt -> build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
copying g2p_seq2seq.egg-info/entry_points.txt -> build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
copying g2p_seq2seq.egg-info/requires.txt -> build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
copying g2p_seq2seq.egg-info/top_level.txt -> build/bdist.macosx-10.7-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
g2p_seq2seq.__pycache__.g2p.cpython-37: module references __file__
creating 'dist/g2p_seq2seq-6.2.2a0-py3.7.egg' and adding 'build/bdist.macosx-10.7-x86_64/egg' to it
removing 'build/bdist.macosx-10.7-x86_64/egg' (and everything under it)
Processing g2p_seq2seq-6.2.2a0-py3.7.egg
removing '/Users/Tristan/anaconda3/lib/python3.7/site-packages/g2p_seq2seq-6.2.2a0-py3.7.egg' (and everything under it)
creating /Users/Tristan/anaconda3/lib/python3.7/site-packages/g2p_seq2seq-6.2.2a0-py3.7.egg
Extracting g2p_seq2seq-6.2.2a0-py3.7.egg to /Users/Tristan/anaconda3/lib/python3.7/site-packages
g2p-seq2seq 6.2.2a0 is already the active version in easy-install.pth
Installing g2p-seq2seq script to /Users/Tristan/anaconda3/bin

Installed /Users/Tristan/anaconda3/lib/python3.7/site-packages/g2p_seq2seq-6.2.2a0-py3.7.egg
Processing dependencies for g2p-seq2seq==6.2.2a0
Searching for tensor2tensor==1.7.0
Best match: tensor2tensor 1.7.0
Processing tensor2tensor-1.7.0-py3.7.egg
tensor2tensor 1.7.0 is already the active version in easy-install.pth
Installing t2t-decoder script to /Users/Tristan/anaconda3/bin
Installing t2t-insights-server script to /Users/Tristan/anaconda3/bin
Installing t2t-translate-all script to /Users/Tristan/anaconda3/bin
Installing t2t-exporter script to /Users/Tristan/anaconda3/bin
Installing t2t-trainer script to /Users/Tristan/anaconda3/bin
Installing t2t-datagen script to /Users/Tristan/anaconda3/bin
Installing t2t-query-server script to /Users/Tristan/anaconda3/bin
Installing t2t-make-tf-configs script to /Users/Tristan/anaconda3/bin
Installing t2t-bleu script to /Users/Tristan/anaconda3/bin
Installing t2t-avg-all script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages/tensor2tensor-1.7.0-py3.7.egg
Searching for tqdm==4.31.1
Best match: tqdm 4.31.1
Adding tqdm 4.31.1 to easy-install.pth file
Installing tqdm script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for sympy==1.3
Best match: sympy 1.3
Adding sympy 1.3 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for six==1.12.0
Best match: six 1.12.0
Adding six 1.12.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for scipy==1.4.1
Best match: scipy 1.4.1
Adding scipy 1.4.1 to easy-install.pth file

Using /Users/Tristan/.local/lib/python3.7/site-packages
Searching for requests==2.21.0
Best match: requests 2.21.0
Adding requests 2.21.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for oauth2client==4.1.3
Best match: oauth2client 4.1.3
Adding oauth2client 4.1.3 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for numpy==1.16.2
Best match: numpy 1.16.2
Adding numpy 1.16.2 to easy-install.pth file
Installing f2py script to /Users/Tristan/anaconda3/bin
Installing f2py3 script to /Users/Tristan/anaconda3/bin
Installing f2py3.7 script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for h5py==2.10.0
Best match: h5py 2.10.0
Adding h5py 2.10.0 to easy-install.pth file

Using /Users/Tristan/.local/lib/python3.7/site-packages
Searching for gym==0.17.2
Best match: gym 0.17.2
Adding gym 0.17.2 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for gunicorn==20.0.4
Best match: gunicorn 20.0.4
Adding gunicorn 20.0.4 to easy-install.pth file
Installing gunicorn script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for google-api-python-client==1.9.3
Best match: google-api-python-client 1.9.3
Adding google-api-python-client 1.9.3 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for gevent==1.4.0
Best match: gevent 1.4.0
Adding gevent 1.4.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for future==0.17.1
Best match: future 0.17.1
Adding future 0.17.1 to easy-install.pth file
Installing futurize script to /Users/Tristan/anaconda3/bin
Installing pasteurize script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for Flask==1.0.2
Best match: Flask 1.0.2
Adding Flask 1.0.2 to easy-install.pth file
Installing flask script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for bz2file==0.98
Best match: bz2file 0.98
Adding bz2file 0.98 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for idna==2.8
Best match: idna 2.8
Adding idna 2.8 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for urllib3==1.24.1
Best match: urllib3 1.24.1
Adding urllib3 1.24.1 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for certifi==2019.3.9
Best match: certifi 2019.3.9
Adding certifi 2019.3.9 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for pyasn1==0.4.8
Best match: pyasn1 0.4.8
Adding pyasn1 0.4.8 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for httplib2==0.18.1
Best match: httplib2 0.18.1
Adding httplib2 0.18.1 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for pyasn1-modules==0.2.7
Best match: pyasn1-modules 0.2.7
Adding pyasn1-modules 0.2.7 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for rsa==4.0
Best match: rsa 4.0
Adding rsa 4.0 to easy-install.pth file
Installing pyrsa-decrypt script to /Users/Tristan/anaconda3/bin
Installing pyrsa-encrypt script to /Users/Tristan/anaconda3/bin
Installing pyrsa-keygen script to /Users/Tristan/anaconda3/bin
Installing pyrsa-priv2pub script to /Users/Tristan/anaconda3/bin
Installing pyrsa-sign script to /Users/Tristan/anaconda3/bin
Installing pyrsa-verify script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for cloudpickle==1.3.0
Best match: cloudpickle 1.3.0
Adding cloudpickle 1.3.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for pyglet==1.5.0
Best match: pyglet 1.5.0
Adding pyglet 1.5.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for setuptools==49.1.0
Best match: setuptools 49.1.0
Adding setuptools 49.1.0 to easy-install.pth file
Installing easy_install script to /Users/Tristan/anaconda3/bin
Installing easy_install-3.8 script to /Users/Tristan/anaconda3/bin

Using /Users/Tristan/.local/lib/python3.7/site-packages
Searching for google-auth==1.18.0
Best match: google-auth 1.18.0
Adding google-auth 1.18.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for google-api-core==1.21.0
Best match: google-api-core 1.21.0
Adding google-api-core 1.21.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for google-auth-httplib2==0.0.3
Best match: google-auth-httplib2 0.0.3
Adding google-auth-httplib2 0.0.3 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for uritemplate==3.0.1
Best match: uritemplate 3.0.1
Adding uritemplate 3.0.1 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for greenlet==0.4.15
Best match: greenlet 0.4.15
Adding greenlet 0.4.15 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for Jinja2==2.10
Best match: Jinja2 2.10
Adding Jinja2 2.10 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for itsdangerous==1.1.0
Best match: itsdangerous 1.1.0
Adding itsdangerous 1.1.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for Click==7.0
Best match: Click 7.0
Adding Click 7.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for Werkzeug==0.14.1
Best match: Werkzeug 0.14.1
Adding Werkzeug 0.14.1 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for cachetools==3.1.1
Best match: cachetools 3.1.1
Adding cachetools 3.1.1 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for pytz==2018.9
Best match: pytz 2018.9
Adding pytz 2018.9 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for protobuf==3.12.2
Best match: protobuf 3.12.2
Processing protobuf-3.12.2-py3.7.egg
protobuf 3.12.2 is already the active version in easy-install.pth

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages/protobuf-3.12.2-py3.7.egg
Searching for googleapis-common-protos==1.52.0
Best match: googleapis-common-protos 1.52.0
Adding googleapis-common-protos 1.52.0 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Searching for MarkupSafe==1.1.1
Best match: MarkupSafe 1.1.1
Adding MarkupSafe 1.1.1 to easy-install.pth file

Using /Users/Tristan/anaconda3/lib/python3.7/site-packages
Finished processing dependencies for g2p-seq2seq==6.2.2a0

The repository doesn't seem to be forward compatible with later versions of tensorflow. I ran into a similar issue and what I did was I created a new virtual environment and manually installed TensorFlow version 1.8.0 and Tensor2Tensor version 1.6.6 using pip. After that I ran the command python setup.py install to install the remaining dependencies.

EDIT: My default Python version is 3.6.9 and while installing this on Python 3.7, I found that tensorflow 1.8 isn't available. Tensorflow version 1.15.1 and Tensor2Tensor version 1.6.6 works fine.

Thanks for the response. I'll have to reattempt this setup later.

I've switched over to https://github.com/Kyubyong/g2p in the meantime, which more up-to-date.