This commit is contained in:
Qiwei Ye 2016-04-17 18:21:37 +08:00
Родитель f31bd6ee91
Коммит 2cb35de7f5
1 изменённых файлов: 16 добавлений и 7 удалений

Просмотреть файл

@ -153,7 +153,9 @@ class minibatchutterancesourcemulti : public minibatchsource
try // this function supports retrying since we read from the unrealible network, i.e. do not return in a broken state
{
msra::asr::htkfeatreader reader; // feature reader (we reinstantiate it for each block, i.e. we reopen the file actually)
auto_timer pageintimer;
auto_timer* p_pageintimer = nullptr;
if (verbosity > 2)
p_pageintimer = new auto_timer();
// if this is the first feature read ever, we explicitly open the first file to get the information such as feature dimension
if (featdim == 0)
{
@ -174,12 +176,19 @@ class minibatchutterancesourcemulti : public minibatchsource
if (!latticesource.empty())
latticesource.getlattices(utteranceset[i].key(), lattices[i], uttframes.cols());
}
// fprintf (stderr, "\n");
if (verbosity)
{
double pageintime = (double)pageintimer;
fprintf(stderr, "requiredata: %d utterances read, time usage = %.8g, total frames = %zu, avg speed = %.8g(frames/sec). \n", (int)utteranceset.size(), pageintime ,totalframes, (double)totalframes /pageintime);
}
if (verbosity)
{
fprintf(stderr, "requiredata: %d utterances read\n", (int)utteranceset.size());
if (verbosity > 2)
{
if (p_pageintimer != nullptr)
{
double pageintime = (double)(*p_pageintimer);
fprintf(stderr, "Chunk read statistics; Total time = %.8g, Num Frames read = %d, Num bytes per frame = %d, Avg I/O bandwidth = %.2g MB/sec).\n",
pageintime, totalframes, (int)featdim * sizeof(float), (featdim * sizeof(float) * totalframes / 1024 / 1024 / pageintime));
}
}
}
}
catch (...)
{