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

TypeError: Can't instantiate abstract class AudioToTextDataLayer with abstract methods create_ports #246

Closed
checker20 opened this issue Dec 27, 2019 · 10 comments

Comments

@checker20
Copy link

Hi, I installed NeMo by cloning the repo and following the installation orders. However when i tried to run the ASR example notebook I got this error:

File "examples/asr/jasper_eval.py", line 96, in main
**eval_dl_params)

Create the Jasper_4x1 encoder as specified, and a CTC decoder

---> 23 encoder = nemo_asr.JasperEncoder(**params['JasperEncoder'])
24
25 decoder = nemo_asr.JasperDecoderForCTC(

TypeError: Can't instantiate abstract class JasperEncoder with abstract methods create_ports

I also get a similar error when trying to evaluate a quartznet on the Librispeech dev:

TypeError: Can't instantiate abstract class AudioToTextDataLayer with abstract methods create_ports

Did I miss something? Thanks in advance.

@okuchaiev
Copy link
Member

looks like you are somehow mixing master branch with 0.9 version.
The latest stable version is 0.9 (and docs and pip correspond to it). Could you please switch to 0.9 version and try again. If you want it from GitHub, the release is here: https://github.com/NVIDIA/NeMo/tree/v0.9.0

@checker20
Copy link
Author

looks like you are somehow mixing master branch with 0.9 version.
The latest stable version is 0.9 (and docs and pip correspond to it). Could you please switch to 0.9 version and try again. If you want it from GitHub, the release is here: https://github.com/NVIDIA/NeMo/tree/v0.9.0

Thanks that fixed it :D

Now I'm trying to install the language model but I keep getting segmentation fault at random times when setup.sh is run the decoders. Sorry for reporting it on the same issue but do you have any idea what it might be wrong or how to clean install it again? (I tried deleting the decoders generated file and rerun install_decoders.sh but that didnt work)

@okuchaiev
Copy link
Member

can you give details about your system (e.g. OS type and RAM size).
"install_decoders.sh" should work on Ubuntu 18.04

@checker20
Copy link
Author

can you give details about your system (e.g. OS type and RAM size).
"install_decoders.sh" should work on Ubuntu 18.04

It's Ubuntu 16.04.6 LTS with 32GB ram

Is it supposed to work only on Ubuntu 18.04?

@okuchaiev
Copy link
Member

can you please paste the full error?

@checker20
Copy link
Author

can you please paste the full error?

I'm gonna paste the last portion before and after the error (the log is a little bigger)

gcc -pthread -B /home/checker/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -Ikenlm -Iopenfst-1.6.3/src/include -IThreadPool -I/home/checker/anaconda3/include/python3.7m -c kenlm/lm/search_trie.cc -o build/temp.linux-x86_64-3.7/kenlm/lm/search_trie.o -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11 -DHAVE_ZLIB
c1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/include/c++/5/string:52:0,
from /usr/include/c++/5/bits/locale_classes.h:40,
from /usr/include/c++/5/bits/ios_base.h:41,
from /usr/include/c++/5/ios:42,
from /usr/include/c++/5/ostream:38,
from kenlm/util/string_piece.hh:55,
from kenlm/util/fake_ostream.hh:6,
from kenlm/util/string_stream.hh:4,
from kenlm/util/exception.hh:4,
from kenlm/lm/lm_exception.hh:6,
from kenlm/lm/config.hh:4,
from kenlm/lm/quantize.hh:5,
from kenlm/lm/quantize.cc:9:
/usr/include/c++/5/bits/basic_string.h: In substitution of ‘template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]’:
/usr/include/c++/5/system_error:343:50: required from here
/usr/include/c++/5/bits/basic_string.h:4783:5: internal compiler error: Segmentation fault
operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-5/README.Bugs for instructions.
gcc -pthread -B /home/checker/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -Ikenlm -Iopenfst-1.6.3/src/include -IThreadPool -I/home/checker/anaconda3/include/python3.7m -c kenlm/lm/value_build.cc -o build/temp.linux-x86_64-3.7/kenlm/lm/value_build.o -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11 -DHAVE_ZLIB
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/checker/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -Ikenlm -Iopenfst-1.6.3/src/include -IThreadPool -I/home/checker/anaconda3/include/python3.7m -c kenlm/lm/read_arpa.cc -o build/temp.linux-x86_64-3.7/kenlm/lm/read_arpa.o -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11 -DHAVE_ZLIB
error: command 'gcc' failed with exit status 1
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

Running it again the script compiles for longer but get this segmentation fault at some point and the stops after a while

openfst-1.6.3/src/include/fst/vector-fst.h: In member function ‘void fst::VectorState<Arc, Allocator>::SetArc(const Arc&, size_t) [with A = fst::ArcTpl<fst::LogWeightTpl >; M = std::allocator<fst::ArcTpl<fst::LogWeightTpl > >; fst::VectorState<Arc, Allocator>::Arc = fst::ArcTpl<fst::LogWeightTpl >; size_t = long unsigned int]’:
openfst-1.6.3/src/include/fst/vector-fst.h:86:14: internal compiler error: Segmentation fault

 if (arcs_[n].ilabel == 0) --niepsilons_;
          ^

Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-5/README.Bugs for instructions.
gcc -pthread -B /home/checker/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -Ikenlm -Iopenfst-1.6.3/src/include -IThreadPool -I/home/checker/anaconda3/include/python3.7m -c ctc_greedy_decoder.cpp -o build/temp.linux-x86_64-3.7/ctc_greedy_decoder.o -O3 -DNDEBUG -DKENLM_MAX_ORDER=6 -std=c++11 -DHAVE_ZLIB
error: command 'gcc' failed with exit status 1

@borisgin
Copy link
Collaborator

borisgin commented Dec 30, 2019

Looks like gcc 5.4.0 bug

@okuchaiev
Copy link
Member

I think @borisgin is right, 16.04 comes with an older gcc. Could you please update your gcc and try again?

@checker20
Copy link
Author

Looks like gcc 5.4.0 bug

I think @borisgin is right, 16.04 comes with an older gcc. Could you please update your gcc and try again?

Yes the first answer in the link fixed it thank you! Now the final (hopefully) problem I'm facing is building the 6-gram LM for librispeech by calling ./build_6-gram_OpenSLR_lm.sh

After that the lm model starts to build but after some minutes I get this error

/build_6-gram_OpenSLR_lm.sh
Requirement already satisfied: pandas in /home/checker/anaconda3/lib/python3.7/site-packages (0.25.3)
Requirement already satisfied: python-dateutil>=2.6.1 in /home/checker/anaconda3/lib/python3.7/site-packages (from pandas) (2.8.0)
Requirement already satisfied: numpy>=1.13.3 in /home/checker/anaconda3/lib/python3.7/site-packages (from pandas) (1.18.0)
Requirement already satisfied: pytz>=2017.2 in /home/checker/anaconda3/lib/python3.7/site-packages (from pandas) (2019.3)
Requirement already satisfied: six>=1.5 in /home/checker/anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas) (1.13.0)
decoders/kenlm/build/bin/lmplz --text language_model/6-gram.txt --arpa language_model/6-gram.arpa --o 6
=== 1/5 Counting and sorting n-grams ===
Reading /home/checker/speech_proj/NeMo/scripts/language_model/6-gram.txt
----5---10---15---20---25---30---35---40---45---50---55---60---65---70---75---80---85---90---95--100
******************************************************************************************Last input should have been poison.
Aborted (core dumped)
decoders/kenlm/build/bin/build_binary trie -q 8 -b 7 -a 256 language_model/6-gram.arpa language_model/6-gram-lm.binary
Reading language_model/6-gram.arpa
----5---10---15---20---25---30---35---40---45---50---55---60---65---70---75---80---85---90---95--100
End of file Byte: 0
ERROR

@okuchaiev
Copy link
Member

closing as this is related to the old version

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

3 participants