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

MappedFile functionality replaced with NULL #8

Closed
yonatankahana opened this issue Dec 6, 2017 · 8 comments
Closed

MappedFile functionality replaced with NULL #8

yonatankahana opened this issue Dec 6, 2017 · 8 comments

Comments

@yonatankahana
Copy link

Hi!
I succedded compile Kaldi with your port of OpenFST and I cant load HCLG model because you changed the method to return always null: https://github.com/kkm000/openfst/blob/win/1.6/src/lib/mapped-file.cc
there is a reason for that change? how can I make my Kaldi code work now?

@jtrmal
Copy link
Collaborator

jtrmal commented Dec 6, 2017 via email

@yonatankahana
Copy link
Author

fst::internal::ConstFstImpl<fst::ArcTpl<fst::TropicalWeightTpl<float> >,unsigned int>::Read(std::basic_istream<char,std::char_traits<char> > & strm, const fst::FstReadOptions & opts) Line 213	C++	Symbols loaded.
 	my.dll!fst::ConstFst<fst::ArcTpl<fst::TropicalWeightTpl<float> >,unsigned int>::Read(std::basic_istream<char,std::char_traits<char> > & strm, const fst::FstReadOptions & opts) Line 274	C++	Symbols loaded.
>	my.dll!fst::ReadFstKaldiGeneric(std::basic_string<char,std::char_traits<char>,std::allocator<char> > rxfilename, bool throw_on_err) Line 76	C++	Symbols loaded.

basically the entry for this issue in this stacktrace comes from 'ReadFstKaldiGeneric'.

@jtrmal
Copy link
Collaborator

jtrmal commented Dec 6, 2017 via email

@jtrmal
Copy link
Collaborator

jtrmal commented Dec 6, 2017

OK, I'm looking at the OpenFST code of ConstFst and I think I see the issue -- while it does not enforce to use MAP mode, it will always use the MappedFile.
@yonatankahana You can backport the code from older ports of OpenFST -- at this time I don't really have too much time nor easy access to win machine. Or maybe @kkm000 might have time but he's usually very busy as well.

@yonatankahana
Copy link
Author

you can see in the file online-nnet2-decoding.h:
there is a class called "SingleUtteranceNnet2Decoder" which its constructor

  SingleUtteranceNnet2Decoder(const OnlineNnet2DecodingConfig &config,
                              const TransitionModel &tmodel,
                              const nnet2::AmNnet &model,
                              const fst::Fst<fst::StdArc> &fst,
                              OnlineFeatureInterface *feature_pipeline);

this method wants an fst::Fstfst::StdArc
which can be only created with ReadFstKaldiGeneric.

@kkm000
Copy link
Owner

kkm000 commented Dec 6, 2017 via email

@kkm000 kkm000 closed this as completed in 989affd Dec 10, 2017
@kkm000
Copy link
Owner

kkm000 commented Dec 10, 2017

Please pull latest code from win/1.6. I have restored the original mapped-file.cc, but disabled code paths actually trying to map the file before allocating memory and reading data into it.

If that does not cover it (and it should, generally), I can implement actual mapping with Win32 functions. But MSVC does not have a compatible mmap(), this is a bit more work than I can dedicte myself to at this moment.

/cc @jtrmal. Change against the original file

@Excalib88
Copy link

I am sorry, but i have problem with openfst. Who can help me please. I cannot load HCLG model on Windows https://pastebin.com/NtaswnAA

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

4 participants