gooofy/py-kaldi-asr

fst related warnings and runtime errors

prajwaljpj opened this issue · 2 comments

I have followed all the rules and successfully did make without any error but i got a few warnings

prajwalrao@prajwal-PC:~/Downloads/gnani.ai/kaldi/kaldi/py-kaldi-asr-master$ make -j 8
python setup.py build_ext --inplace
looking for atlas library, trying pkg-config first...
looking for atlas library, pkg-config found it
running build_ext
cythoning kaldiasr/nnet3.pyx to kaldiasr/nnet3.cpp
warning: kaldiasr/nnet3.pyx:140:64: local variable 'likelihood' referenced before assignment
warning: kaldiasr/nnet3.pyx:141:31: local variable 'likelihood' referenced before assignment
building 'kaldiasr.nnet3' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/kaldiasr
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/atlas/ -I/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src -I/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include -I/usr/include/atlas/ -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c kaldiasr/nnet3.cpp -o build/temp.linux-x86_64-2.7/kaldiasr/nnet3.o -Wall -pthread -std=c++11 -DKALDI_DOUBLEPRECISION=0 -Wno-sign-compare -Wno-unused-local-typedefs -Winit-self -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -g
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1809:0,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from kaldiasr/nnet3.cpp:545:
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^~~~~~~
In file included from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/fstlib.h:123:0,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-lib.h:22,
                 from kaldiasr/nnet3_wrappers.h:27,
                 from kaldiasr/nnet3.cpp:547:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:117:54: warning: ‘TokenType’ is deprecated: Use fst::StringTokenType [-Wdeprecated-declarations]
                           bool allow_negative = false)
                                                      ^
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:107:55: note: declared here
   enum OPENFST_DEPRECATED("Use fst::StringTokenType") TokenType {
                                                       ^~~~~~~~~
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:207:59: warning: ‘TokenType’ is deprecated: Use fst::StringTokenType [-Wdeprecated-declarations]
                          const SymbolTable *syms = nullptr)
                                                           ^
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:199:55: note: declared here
   enum OPENFST_DEPRECATED("Use fst::StringTokenType") TokenType {
                                                       ^~~~~~~~~
In file included from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/pre-determinize.h:94:0,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:29,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils.h:427,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst-inl.h:23,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst.h:476,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-lib.h:23,
                 from kaldiasr/nnet3_wrappers.h:27,
                 from kaldiasr/nnet3.cpp:547:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/pre-determinize-inl.h: In instantiation of ‘void fst::PreDeterminize(fst::MutableFst<Arc>*, typename Arc::Label, std::vector<B>*) [with Arc = fst::ArcTpl<fst::LogWeightTpl<float> >; Int = int; typename Arc::Label = int]’:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:348:17:   required from ‘void fst::SafeDeterminizeWrapper(fst::MutableFst<Arc>*, fst::MutableFst<Arc>*, float) [with Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:412:51:   required from here
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/pre-determinize-inl.h:451:16: warning: unused variable ‘inserted’ [-Wunused-variable]
           bool inserted = (arc_hash[arc.ilabel].insert(this_pair)).second;
                ^~~~~~~~
In file included from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star.h:117:0,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils.h:31,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst-inl.h:23,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst.h:476,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-lib.h:23,
                 from kaldiasr/nnet3_wrappers.h:27,
                 from kaldiasr/nnet3.cpp:547:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h: In instantiation of ‘fst::DeterminizerStar<F>::OutputStateId fst::DeterminizerStar<F>::SubsetToStateId(const std::vector<fst::DeterminizerStar<F>::Element>&) [with F = fst::VectorFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; fst::DeterminizerStar<F>::OutputStateId = int]’:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:200:45:   required from ‘void fst::DeterminizerStar<F>::Determinize(bool*) [with F = fst::VectorFst<fst::ArcTpl<fst::LogWeightTpl<float> > >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:631:3:   required from ‘bool fst::DeterminizeStar(F&, fst::MutableFst<typename Impl::Arc>*, float, bool*, int, bool) [with F = fst::VectorFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; typename Impl::Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:381:70:   required from here
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:561:12: warning: unused variable ‘ans’ [-Wunused-variable]
       bool ans = hash_.insert(std::pair<const vector<Element>*,
            ^~~
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h: In instantiation of ‘fst::DeterminizerStar<F>::OutputStateId fst::DeterminizerStar<F>::SubsetToStateId(const std::vector<fst::DeterminizerStar<F>::Element>&) [with F = fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; fst::DeterminizerStar<F>::OutputStateId = int]’:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:200:45:   required from ‘void fst::DeterminizerStar<F>::Determinize(bool*) [with F = fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<float> > >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:631:3:   required from ‘bool fst::DeterminizeStar(F&, fst::MutableFst<typename Impl::Arc>*, float, bool*, int, bool) [with F = fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; typename Impl::Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:351:18:   required from ‘void fst::SafeDeterminizeWrapper(fst::MutableFst<Arc>*, fst::MutableFst<Arc>*, float) [with Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:412:51:   required from here
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:561:12: warning: unused variable ‘ans’ [-Wunused-variable]
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/atlas/ -I/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src -I/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include -I/usr/include/atlas/ -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c kaldiasr/nnet3_wrappers.cpp -o build/temp.linux-x86_64-2.7/kaldiasr/nnet3_wrappers.o -Wall -pthread -std=c++11 -DKALDI_DOUBLEPRECISION=0 -Wno-sign-compare -Wno-unused-local-typedefs -Winit-self -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -g
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/fstlib.h:123:0,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-lib.h:22,
                 from kaldiasr/nnet3_wrappers.h:27,
                 from kaldiasr/nnet3_wrappers.cpp:25:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:117:54: warning: ‘TokenType’ is deprecated: Use fst::StringTokenType [-Wdeprecated-declarations]
                           bool allow_negative = false)
                                                      ^
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:107:55: note: declared here
   enum OPENFST_DEPRECATED("Use fst::StringTokenType") TokenType {
                                                       ^~~~~~~~~
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:207:59: warning: ‘TokenType’ is deprecated: Use fst::StringTokenType [-Wdeprecated-declarations]
                          const SymbolTable *syms = nullptr)
                                                           ^
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/include/fst/string.h:199:55: note: declared here
   enum OPENFST_DEPRECATED("Use fst::StringTokenType") TokenType {
                                                       ^~~~~~~~~
In file included from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/pre-determinize.h:94:0,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:29,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils.h:427,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst-inl.h:23,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst.h:476,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-lib.h:23,
                 from kaldiasr/nnet3_wrappers.h:27,
                 from kaldiasr/nnet3_wrappers.cpp:25:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/pre-determinize-inl.h: In instantiation of ‘void fst::PreDeterminize(fst::MutableFst<Arc>*, typename Arc::Label, std::vector<B>*) [with Arc = fst::ArcTpl<fst::LogWeightTpl<float> >; Int = int; typename Arc::Label = int]’:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:348:17:   required from ‘void fst::SafeDeterminizeWrapper(fst::MutableFst<Arc>*, fst::MutableFst<Arc>*, float) [with Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:412:51:   required from here
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/pre-determinize-inl.h:451:16: warning: unused variable ‘inserted’ [-Wunused-variable]
           bool inserted = (arc_hash[arc.ilabel].insert(this_pair)).second;
                ^~~~~~~~
In file included from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star.h:117:0,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils.h:31,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst-inl.h:23,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/context-fst.h:476,
                 from /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-lib.h:23,
                 from kaldiasr/nnet3_wrappers.h:27,
                 from kaldiasr/nnet3_wrappers.cpp:25:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h: In instantiation of ‘fst::DeterminizerStar<F>::OutputStateId fst::DeterminizerStar<F>::SubsetToStateId(const std::vector<fst::DeterminizerStar<F>::Element>&) [with F = fst::VectorFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; fst::DeterminizerStar<F>::OutputStateId = int]’:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:200:45:   required from ‘void fst::DeterminizerStar<F>::Determinize(bool*) [with F = fst::VectorFst<fst::ArcTpl<fst::LogWeightTpl<float> > >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:631:3:   required from ‘bool fst::DeterminizeStar(F&, fst::MutableFst<typename Impl::Arc>*, float, bool*, int, bool) [with F = fst::VectorFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; typename Impl::Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:381:70:   required from here
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:561:12: warning: unused variable ‘ans’ [-Wunused-variable]
       bool ans = hash_.insert(std::pair<const vector<Element>*,
            ^~~
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h: In instantiation of ‘fst::DeterminizerStar<F>::OutputStateId fst::DeterminizerStar<F>::SubsetToStateId(const std::vector<fst::DeterminizerStar<F>::Element>&) [with F = fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; fst::DeterminizerStar<F>::OutputStateId = int]’:
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:200:45:   required from ‘void fst::DeterminizerStar<F>::Determinize(bool*) [with F = fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<float> > >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:631:3:   required from ‘bool fst::DeterminizeStar(F&, fst::MutableFst<typename Impl::Arc>*, float, bool*, int, bool) [with F = fst::MutableFst<fst::ArcTpl<fst::LogWeightTpl<float> > >; typename Impl::Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:351:18:   required from ‘void fst::SafeDeterminizeWrapper(fst::MutableFst<Arc>*, fst::MutableFst<Arc>*, float) [with Arc = fst::ArcTpl<fst::LogWeightTpl<float> >]’
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/fstext-utils-inl.h:412:51:   required from here
/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/fstext/determinize-star-inl.h:561:12: warning: unused variable ‘ans’ [-Wunused-variable]
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-lMBuS3/python2.7-2.7.12=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/kaldiasr/nnet3.o build/temp.linux-x86_64-2.7/kaldiasr/nnet3_wrappers.o -L/usr/lib/atlas-base -L/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/src/lib -L/home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/kaldi/tools/openfst/lib -L/usr/lib/atlas-base -latlas -lfst -lkaldi-decoder -lkaldi-lat -lkaldi-fstext -lkaldi-hmm -lkaldi-feat -lkaldi-transform -lkaldi-gmm -lkaldi-tree -lkaldi-util -lkaldi-matrix -lkaldi-base -lkaldi-nnet3 -lkaldi-online2 -lkaldi-cudamatrix -lkaldi-ivector -latlas -o /home/prajwalrao/Downloads/gnani.ai/kaldi/kaldi/py-kaldi-asr-master/kaldiasr/nnet3.so

If this is an issue please do tell me where I am going wrong, because when I run an example file line chain_online.py I get this,

prajwalrao@prajwal-PC:~/Downloads/gnani.ai/kaldi/kaldi/py-kaldi-asr-master$ python chain_online.py 
tdnn_44k loading model...
Traceback (most recent call last):
  File "chain_online.py", line 43, in <module>
    kaldi_model = KaldiNNet3OnlineModel (MODELDIR, model, acoustic_scale=1.0, beam=7.0, frame_subsampling_factor=3)
  File "kaldiasr/nnet3.pyx", line 100, in kaldiasr.nnet3.KaldiNNet3OnlineModel.__cinit__
    self.model_wrapper = new NNet3OnlineModelWrapper(beam,
RuntimeError

the warnings are pretty normal. I suspect the example does not find the chain model files (downloaded from here: http://goofy.zamia.org/voxforge/), it expects them in
data/models/kaldi-chain-voxforge-en-latest

I was able to solve the problem as my splice.config file --left-context=3 --right-context=3 in the same line rather than being in different lines. thank you.