ERROR: FstImpl::ReadHeader: FST not of type vector: <unspecified>

860 views
Skip to first unread message

Ri ki

unread,
Jul 10, 2017, 10:47:17 PM7/10/17
to kaldi-help
Hi,

Any ideas why I am getting this error? I am pretty sure it's some configuration issue which i am not sure what it is.
The same model works ( this is the aspire model) when i run with the regular kaldi decoder without any issues. I am now trying to use this in the python wrapper sample and i am getting this error. What am i doing wrong?

tdnn_7b loading model...
LOG
([5.2.52~1-cac0]:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG
([5.2.52~1-cac0]:ComputeDerivedVars():ivector-extractor.cc:204) Done.
ERROR
: FstImpl::ReadHeader: FST not of type vector: <unspecified>
ERROR
([5.2.52~1-cac0]:ReadFstKaldi():kaldi-fst-io.cc:40) Could not read fst from data/models/aspire/tdnn_7b/HCLG.fst


Thanks in advance.

Daniel Povey

unread,
Jul 10, 2017, 10:52:07 PM7/10/17
to kaldi-help
The code, since it's external to the kaldi project (?) may not have
been kept up to date. I believe ReadFstKaldi() should now be
ReadFstKaldiGeneric(), to allowe reading const_fst.
> --
> Go to http://kaldi-asr.org/forums.html find out how to join
> ---
> You received this message because you are subscribed to the Google Groups
> "kaldi-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kaldi-help+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ri ki

unread,
Jul 10, 2017, 11:02:22 PM7/10/17
to kaldi-help
Dan,

Thanks for the quick reply. You are right. Here is the relevant code:

        // Input FST is just one FST, not a table of FSTs.
        decode_fst = fst::ReadFstKaldi(fst_in_str);


But it did work another fst that came with the sample project. Are these two different types of fsts then?

The above code did compile with the latest kaldi source though. So I am guessing it's not deprecated then?

And if i change the code to ReadFstKaldiGeneric() as you suggest, will it work for all types of fsts?





> For more options, visit https://groups.google.com/d/optout.

--
Go to http://kaldi-asr.org/forums.html find out how to join
---
You received this message because you are subscribed to a topic in the Google Groups "kaldi-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kaldi-help/0SuCkeHyUmU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kaldi-help+unsubscribe@googlegroups.com.

Daniel Povey

unread,
Jul 10, 2017, 11:08:33 PM7/10/17
to kaldi-help
change it, it should work.
>> > email to kaldi-help+...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> Go to http://kaldi-asr.org/forums.html find out how to join
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "kaldi-help" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/kaldi-help/0SuCkeHyUmU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> kaldi-help+...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> Go to http://kaldi-asr.org/forums.html find out how to join
> ---
> You received this message because you are subscribed to the Google Groups
> "kaldi-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kaldi-help+...@googlegroups.com.

Ri ki

unread,
Jul 11, 2017, 3:58:32 PM7/11/17
to kaldi-help, dpo...@gmail.com
thanks Dan. it worked for both the fsts i think. it definitely worked for the fst that came with the python wrapper sample but for the aspire model, it did seem to finish successfully but i did not get the utternace output. i checked to make sure the sampling rate is 8K.

I am following the instructions from this site:
https://chrisearch.wordpress.com/2017/03/11/speech-recognition-using-kaldi-extending-and-using-the-aspire-model/

i have question about the command:


online2-wav-nnet3-latgen-faster \
 
--online=false \
 
--do-endpointing=false \
 
--frame-subsampling-factor=3 \
 
--config=exp/tdnn_7b_chain_online/conf/online.conf \
 
--max-active=7000 \
 
--beam=15.0 \
 
--lattice-beam=6.0 \
 
--acoustic-scale=1.0 \
 
--word-symbol-table=exp/tdnn_7b_chain_online/graph_pp/words.txt \
  exp
/tdnn_7b_chain_online/final.mdl \
  exp
/tdnn_7b_chain_online/graph_pp/HCLG.fst \
 
'ark:echo utterance-id1 utterance-id1|' \
 
'scp:echo utterance-id1 <your_8khz_file.wav>|' \
 
'ark:/dev/null'



'ark:echo utterance-id1 utterance-id1|' \
 
'scp:echo utterance-id1 <your_8khz_file.wav>|' \
 
'ark:/dev/null'


What do the last three lines mean? When I pass the above on command line with the regular kaldi source, it works perfectly and i get the utterance text. But to make it work with the wrapper sample, i passed all the parameters( except the ark and scp utterance-d lines. I did specify the Wav file to decode though) Could this be the reason i am not getting any output?

If i have to pass in those parameters as part of the wrapper sample(i.e not as command line params), what and where should i put them as?

Thanks again

Daniel Povey

unread,
Jul 11, 2017, 4:48:08 PM7/11/17
to Ri ki, kaldi-help
I can't answer that question just from memory- you need to look at the
code of the binary and see what those arguments get passed to. The
/dev/null may mean that the lattices are piped to /dev/null and it
relies on the printed (debug) output for the user to see what's going
on-- I don't know how things work in the wrapper as I wasn't involved
in it.

Dan

蔡红

unread,
Jul 12, 2017, 4:06:44 AM7/12/17
to kaldi...@googlegroups.com, Daniel Povey
Dear Dan,

I have the similar issue about FST while training the example of THCHS30, the errors are:

std::bad_allocERROR: FstHeader::Read: Bad FST header: -
ERROR (fstdeterminizestar:ReadFstKaldi():fstext/fstext-utils-inl.h:1300) Reading FST: error reading FST header from standard input
ERROR (fstminimizeencoded:ReadFstKaldi():fstext/fstext-utils-inl.h:1300) Reading FST: error reading FST header from standard input

If just changing ReadFstKaldi() to ReadFstKaldiGeneric(),  there are errors while compiling because of the difference of the return pointer, VectorFst<StdArc> and Fst<StdArc>. Could you check how to modify the files of fstdeterminizestar.cc and fstminimizeencoded.cc?

Thank you very much!

BRs
Anne
>  Daniel Povey <dpo...@gmail.com>
>  kaldi-help <kaldi...@googlegroups.com>
>  Re: [kaldi-help] ERROR: FstImpl::ReadHeader: FST not of type vector: <unspecified>
> 
> change it, it should work.
> 
> On Mon, Jul 10, 2017 at 11:02 PM, Ri ki <maria...@gmail.com> wrote:
> > Dan,
> >
> > Thanks for the quick reply. You are right. Here is the relevant code:
> >
> >         // Input FST is just one FST, not a table of FSTs.
> >         decode_fst = fst::ReadFstKaldi(fst_in_str);
> >
> >
> > But it did work another fst that came with the sample project. Are these two
> > different types of fsts then?
> >
> > The above code did compile with the latest kaldi source though. So I am
> > guessing it's not deprecated then?
> >
> > And if i change the code to ReadFstKaldiGeneric() as you suggest, will it
> > work for all types of fsts?
> >
> >
> >
> >
> > On Mon, Jul 10, 2017 at 10:52 PM, Daniel Povey <dpo...@gmail.com> wrote:
> >>
> >> The code, since it's external to the kaldi project (?) may not have
> >> been kept up to date.  I believe ReadFstKaldi() should now be
> >> ReadFstKaldiGeneric(), to allowe reading const_fst.
> >>
> >>
> >> On Mon, Jul 10, 2017 at 10:47 PM, Ri ki <maria...@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > Any ideas why I am getting this error? I am pretty sure it's some
> >> > configuration issue which i am not sure what it is.
> >> > The same model works ( this is the aspire model) when i run with the
> >> > regular
> >> > kaldi decoder without any issues. I am now trying to use this in the
> >> > python
> >> > wrapper sample and i am getting this error. What am i doing wrong?
> >> >
> >> > tdnn_7b loading model...
> >> > LOG ([5.2.52~1-cac0]:ComputeDerivedVars():ivector-extractor.cc:183)
> >> > Computing derived variables for iVector extractor
> >> > LOG ([5.2.52~1-cac0]:ComputeDerivedVars():ivector-extractor.cc:204)
> >> > Done.
> >> > ERROR: FstImpl::ReadHeader: FST not of type vector: <unspecified>
> >> > ERROR ([5.2.52~1-cac0]:ReadFstKaldi():kaldi-fst-io.cc:40) Could not read
> >> > fst
> >> > from data/models/aspire/tdnn_7b/HCLG.fst
> >> >
> >> >
> >> > Thanks in advance.
> >> >
> >> > --
> >> > Go to http://kaldi-asr.org/forums.html find out how to join
> >> > ---
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "kaldi-help" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to kaldi-help+...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> Go to http://kaldi-asr.org/forums.html find out how to join
> >> ---
> >> You received this message because you are subscribed to a topic in the
> >> Google Groups "kaldi-help" group.
> >> To unsubscribe from this topic, visit
> >> https://groups.google.com/d/topic/kaldi-help/0SuCkeHyUmU/unsubscribe.
> >> To unsubscribe from this group and all its topics, send an email to
> >> kaldi-help+...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > Go to http://kaldi-asr.org/forums.html find out how to join
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "kaldi-help" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to kaldi-help+...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> Go to http://kaldi-asr.org/forums.html find out how to join
> --- 
> You received this message because you are subscribed to the Google Groups "kaldi-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

anand

unread,
Jul 12, 2017, 4:35:53 AM7/12/17
to kaldi-help, dpo...@gmail.com
FYI: <spk2utt-rspecifier> <wav-rspecifier> <lattice-wspecifier>

Ri ki

unread,
Jul 12, 2017, 1:59:22 PM7/12/17
to kaldi-help, dpo...@gmail.com, cai...@d-power.com.cn
I did the following to get rid of that error. Not sure if this is what you are asking for:

decode_fst = CastOrConvertToVectorFst(fst::ReadFstKaldiGeneric(fst_in_str));

Ri ki

unread,
Jul 12, 2017, 2:03:42 PM7/12/17
to kaldi-help, dpo...@gmail.com
Thanks anand. I have been poring over documentation to figure this out.

so what are these <spk2utt-rspecifier> <wav-rspecifier> <lattice-wspecifier>??

I read that "r" stands for read and "w" stands for write. What does "specifier" mean?

Are these files? if so what is the format for each one of these? can you please provide a sample file for each one(or point me to one in the kaldi source)?

Thank you

Daniel Povey

unread,
Jul 12, 2017, 2:26:09 PM7/12/17
to 蔡红, kaldi-help
Anne, your problems are unrelated to code changes, they are because
you don't have enough memory (std::bad_alloc) or possibly because you
are using a 32 bit machine.

Daniel Povey

unread,
Jul 12, 2017, 2:27:00 PM7/12/17
to Ri ki, kaldi-help
Ri ki:
you need to read the 'I/O' section of the kaldi documentation,
kaldi-asr.org/doc/.
Dan

Ri ki

unread,
Jul 12, 2017, 4:52:49 PM7/12/17
to kaldi-help, maria...@gmail.com, dpo...@gmail.com
Thanks Dan. I am currently reading through the docs.

Thank you

蔡红

unread,
Jul 13, 2017, 5:52:27 AM7/13/17
to kaldi...@googlegroups.com, Daniel Povey, Ri ki
Dear Dan/Ri,

It should be memory issue as I run kaldi on ubuntu 64bit under VMware workstation, there is no enough memory.
Thank you very much!

BRs
Anne

>  Daniel Povey <dpo...@gmail.com>
>  Re: [kaldi-help] ERROR: FstImpl::ReadHeader: FST not of type vector: <unspecified>
> 
> Anne, your problems are unrelated to code changes, they are because
> you don't have enough memory (std::bad_alloc) or possibly because you
> are using a 32 bit machine.
> 
> 
> On Wed, Jul 12, 2017 at 4:05 AM, 蔡红 <cai...@d-power.com.cn> wrote:
> > Dear Dan,
> >
> > I have the similar issue about FST while training the example of THCHS30,
> > the errors are:
> >
> > std::bad_allocERROR: FstHeader::Read: Bad FST header: -
> > ERROR (fstdeterminizestar:ReadFstKaldi():fstext/fstext-utils-inl.h:1300)
> > Reading FST: error reading FST header from standard input
> > ERROR (fstminimizeencoded:ReadFstKaldi():fstext/fstext-utils-inl.h:1300)
> > Reading FST: error reading FST header from standard input
> >
> > If just changing ReadFstKaldi() to ReadFstKaldiGeneric(),  there are errors
> > while compiling because of the difference of the return pointer,
> > VectorFst<StdArc> and Fst<StdArc>. Could you check how to modify the files
> > of fstdeterminizestar.cc and fstminimizeencoded.cc?
> >
> > Thank you very much!
> >
> > BRs
> > Anne
> >
> >>  Daniel Povey <dpo...@gmail.com>
> >>  kaldi-help <kaldi...@googlegroups.com>
> >>  Re: [kaldi-help] ERROR: FstImpl::ReadHeader: FST not of type vector:
> >> <unspecified>
> >>
> >> change it, it should work.
> >>
> >> On Mon, Jul 10, 2017 at 11:02 PM, Ri ki <maria...@gmail.com> wrote:
> >> > Dan,
> >> >
> >> > Thanks for the quick reply. You are right. Here is the relevant code:
> >> >
> >> >         // Input FST is just one FST, not a table of FSTs.
> >> >         decode_fst = fst::ReadFstKaldi(fst_in_str);
> >> >
> >> >
> >> > But it did work another fst that came with the sample project. Are these
> >> > two
> >> > different types of fsts then?
> >> >
> >> > The above code did compile with the latest kaldi source though. So I am
> >> > guessing it's not deprecated then?
> >> >
> >> > And if i change the code to ReadFstKaldiGeneric() as you suggest, will
> >> > it
> >> > work for all types of fsts?
> >> >
> >> >
> >> >
> >> >
> >> > On Mon, Jul 10, 2017 at 10:52 PM, Daniel Povey <dpo...@gmail.com> wrote:
> >> >>
> >> >> The code, since it's external to the kaldi project (?) may not have
> >> >> been kept up to date.  I believe ReadFstKaldi() should now be
> >> >> ReadFstKaldiGeneric(), to allowe reading const_fst.
> >> >>
> >> >>
> >> >> On Mon, Jul 10, 2017 at 10:47 PM, Ri ki <maria...@gmail.com> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > Any ideas why I am getting this error? I am pretty sure it's some
> >> >> > configuration issue which i am not sure what it is.
> >> >> > The same model works ( this is the aspire model) when i run with the
> >> >> > regular
> >> >> > kaldi decoder without any issues. I am now trying to use this in the
> >> >> > python
> >> >> > wrapper sample and i am getting this error. What am i doing wrong?
> >> >> >
> >> >> > tdnn_7b loading model...
> >> >> > LOG ([5.2.52~1-cac0]:ComputeDerivedVars():ivector-extractor.cc:183)
> >> >> > Computing derived variables for iVector extractor
> >> >> > LOG ([5.2.52~1-cac0]:ComputeDerivedVars():ivector-extractor.cc:204)
> >> >> > Done.
> >> >> > ERROR: FstImpl::ReadHeader: FST not of type vector: <unspecified>
> >> >> > ERROR ([5.2.52~1-cac0]:ReadFstKaldi():kaldi-fst-io.cc:40) Could not
> >> >> > read
> >> >> > fst
> >> >> > from data/models/aspire/tdnn_7b/HCLG.fst
> >> >> >
> >> >> >
> >> >> > Thanks in advance.
> >> >> >
> >> >> > --
> >> >> > Go to http://kaldi-asr.org/forums.html find out how to join
> >> >> > ---
> >> >> > You received this message because you are subscribed to the Google
> >> >> > Groups
> >> >> > "kaldi-help" group.
> >> >> > To unsubscribe from this group and stop receiving emails from it,
> >> >> > send
> >> >> > an
> >> >> > email to kaldi-help+...@googlegroups.com.
> >> >> > For more options, visit https://groups.google.com/d/optout.
> >> >>
> >> >> --
> >> >> Go to http://kaldi-asr.org/forums.html find out how to join
> >> >> ---
> >> >> You received this message because you are subscribed to a topic in the
> >> >> Google Groups "kaldi-help" group.
> >> >> To unsubscribe from this topic, visit
> >> >> https://groups.google.com/d/topic/kaldi-help/0SuCkeHyUmU/unsubscribe.
> >> >> To unsubscribe from this group and all its topics, send an email to
> >> >> kaldi-help+...@googlegroups.com.
> >> >> For more options, visit https://groups.google.com/d/optout.
> >> >
> >> >
> >> > --
> >> > Go to http://kaldi-asr.org/forums.html find out how to join
> >> > ---
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "kaldi-help" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to kaldi-help+...@googlegroups.com.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> Go to http://kaldi-asr.org/forums.html find out how to join
> >> ---
> >> You received this message because you are subscribed to the Google Groups
> >> "kaldi-help" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to kaldi-help+...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> 
> -- 
> Go to http://kaldi-asr.org/forums.html find out how to join
> --- 
> You received this message because you are subscribed to the Google Groups "kaldi-help" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages