Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR (arpa2fst[5.5.958~1-57f8d]:Input():kaldi-io.cc:756) Error opening input stream temp/lang/words.txt #3

Open
Shiro-LK opened this issue Aug 2, 2021 · 1 comment

Comments

@Shiro-LK
Copy link

Shiro-LK commented Aug 2, 2021

Hello,

I am trying to launch the example in the readme.txt,
unfortunately I don't have any files in the folder temp/lang which make me having this error :

FileNotFoundError: [Errno 2] No such file or directory: 'temp/lang/words.txt'
temp/trans.txt: No such file or directory
cat: temp/custom.lm: No such file or directory
arpa2fst --disambig-symbol=#0 --read-symbol-table=temp/lang/words.txt - temp/lang/G.fst
ERROR (arpa2fst[5.5.958~1-57f8d]:Input():kaldi-io.cc:756) Error opening input stream temp/lang/words.txt

[ Stack-Trace: ]
/home/Shiro/kaldi/src/lib/libkaldi-base.so(kaldi::MessageLogger::LogMessage() const+0xb42) [0x7f20a5c98732]
arpa2fst(kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&)+0x21) [0x55c95b2f3367]
/home/Shiro/kaldi/src/lib/libkaldi-util.so(kaldi::Input::Input(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool*)+0xbe) [0x7f20a5ebab08]
arpa2fst(main+0x596) [0x55c95b2f1aa0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f20a4f8ebf7]
arpa2fst(_start+0x2a) [0x55c95b2f142a]

kaldi::KaldiFatalErrormkgraph.sh: expected temp/lang/L.fst to exist
Traceback (most recent call last):
File "extract_likelihood_per_frame.py", line 26, in
main()
File "extract_likelihood_per_frame.py", line 21, in main
fo.write(lpf + "\n")
UnboundLocalError: local variable 'lpf' referenced before assignment
lattice-1best ark:- ark:-
lattice-align-words-lexicon temp/lang/phones/align_lexicon.int exp/tdnn_7b_chain_online/final.mdl 'ark:gunzip -c temp/out/lat.1.gz|' ark:-
ERROR (lattice-align-words-lexicon[5.5.958~1-57f8d]:Input():kaldi-io.cc:756) Error opening input stream temp/lang/phones/align_lexicon.int

[ Stack-Trace: ]
/home/Shiro/kaldi/src/lib/libkaldi-base.so(kaldi::MessageLogger::LogMessage() const+0xb42) [0x7ff1915ee732]
lattice-align-words-lexicon(kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&)+0x21) [0x55fb185d7855]
/home/Shiro/kaldi/src/lib/libkaldi-util.so(kaldi::Input::Input(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool*)+0xbe) [0x7ff191ab8b08]
lattice-align-words-lexicon(main+0x273) [0x55fb185d579d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7ff1906c5bf7]
lattice-align-words-lexicon(_start+0x2a) [0x55fb185d544a]

kaldi::KaldiFatalErrornbest-to-ctm ark:- temp/out/align.ctm
LOG (lattice-1best[5.5.9581-57f8d]:main():lattice-1best.cc:103) Done converting 0 to best path, 0 had errors.
LOG (nbest-to-ctm[5.5.958
1-57f8d]:main():nbest-to-ctm.cc:119) Converted 0 linear lattices to ctm format; 0 had errors.
gzip: temp/out/lat.1.gz: No such file or directory
lattice-1best --acoustic-scale=1 ark:temp/out/lat.1 ark:temp/out/1best.lats
LOG (lattice-1best[5.5.9581-57f8d]:main():lattice-1best.cc:103) Done converting 0 to best path, 0 had errors.
nbest-to-linear ark:temp/out/1best.lats ark,t:temp/out/1.ali
LOG (nbest-to-linear[5.5.958
1-57f8d]:main():nbest-to-linear.cc:89) Done 0 n-best entries, 0 had errors.
ali-to-phones --ctm-output exp/tdnn_7b_chain_online/final.mdl ark:temp/out/1.ali temp/out/phone_alined.ctm
ERROR (ali-to-phones[5.5.958~1-57f8d]:Input():kaldi-io.cc:756) Error opening input stream exp/tdnn_7b_chain_online/final.mdl

[ Stack-Trace: ]
/home/Shiro/kaldi/src/lib/libkaldi-base.so(kaldi::MessageLogger::LogMessage() const+0xb42) [0x7f803f618732]
ali-to-phones(kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&)+0x21) [0x558d462e3953]
/home/Shiro/kaldi/src/lib/libkaldi-util.so(kaldi::Input::Input(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool*)+0xbe) [0x7f803fae2b08]
ali-to-phones(main+0x450) [0x558d462e1c1a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f803ea82bf7]
ali-to-phones(_start+0x2a) [0x558d462e16ea]

kaldi::KaldiFatalErrorTraceback (most recent call last):
File "scripts/convert_ctm.py", line 48, in
main()
File "scripts/convert_ctm.py", line 32, in main
lines = [line.strip() for line in open(args.input_words)]
FileNotFoundError: [Errno 2] No such file or directory: 'temp/lang/words.txt'
Traceback (most recent call last):
File "scripts/convert_ctm.py", line 48, in
main()
File "scripts/convert_ctm.py", line 32, in main
lines = [line.strip() for line in open(args.input_words)]
FileNotFoundError: [Errno 2] No such file or directory: 'temp/lang/phones.txt'
copy-int-vector ark:temp/out/1.ali ark,t:temp/out/transids.txt
LOG (copy-int-vector[5.5.9581-57f8d]:main():copy-int-vector.cc:83) Copied 0 vectors of int32.
show-transitions temp/lang/phones.txt exp/tdnn_7b_chain_online/final.mdl
ERROR: SymbolTable::ReadText: Can't open file temp/lang/phones.txt
ERROR (show-transitions[5.5.958
1-57f8d]:main():show-transitions.cc:56) Could not read symbol table from file temp/lang/phones.txt

[ Stack-Trace: ]
/home/Shiro/kaldi/src/lib/libkaldi-base.so(kaldi::MessageLogger::LogMessage() const+0xb42) [0x7fa88fff3732]
show-transitions(kaldi::MessageLogger::LogAndThrow::operator=(kaldi::MessageLogger const&)+0x21) [0x55dc41c5b509]
show-transitions(main+0x1c3) [0x55dc41c5ae0d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fa88f2e9bf7]
show-transitions(_start+0x2a) [0x55dc41c5ab6a]

Am I the only one to have this issue ?
Do I need to install or download something excepted Kaldi and SRILM?

@amirharati
Copy link
Owner

Have you download the models using: sh download_extract.sh
also you should change your kaldi path (check the readme).

Also this code is relatively old and Kaldi has probably get updated in the meantime. I have not tested this code for a while and I don't have the time right now for testing with new kaldi, If you have the models and also updated the path and still get some error then perhaps you need to use older version of the Kaldi. I don't remember the version at time of writing this scripts, however you can approximate based on time of release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants