Skip to content
Snippets Groups Projects
Commit a796a527 authored by Dan Povey's avatar Dan Povey
Browse files

trunk: small change to ivector-extractor-acc-stats.cc (make it less...

trunk: small change to ivector-extractor-acc-stats.cc (make it less memory-hungry when forking to open tables)

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@3413 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent c271ba38
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,6 @@ class IvectorTask {
int main(int argc, char *argv[]) {
using namespace kaldi;
typedef kaldi::int32 int32;
typedef kaldi::int64 int64;
try {
const char *usage =
"Accumulate stats for iVector extractor training\n"
......@@ -95,6 +94,14 @@ int main(int argc, char *argv[]) {
posteriors_rspecifier = po.GetArg(3),
accs_wxfilename = po.GetArg(4);
// Initialize these Reader objects before reading the IvectorExtractor,
// because it uses up a lot of memory and any fork() after that will
// be in danger of causing an allocation failure.
SequentialBaseFloatMatrixReader feature_reader(feature_rspecifier);
RandomAccessPosteriorReader posteriors_reader(posteriors_rspecifier);
IvectorExtractor extractor;
ReadKaldiObject(ivector_extractor_rxfilename, &extractor);
......@@ -104,10 +111,6 @@ int main(int argc, char *argv[]) {
int64 tot_t = 0;
int32 num_done = 0, num_err = 0;
SequentialBaseFloatMatrixReader feature_reader(feature_rspecifier);
RandomAccessPosteriorReader posteriors_reader(posteriors_rspecifier);
{
TaskSequencer<IvectorTask> sequencer(sequencer_opts);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment