Better error message when DBN conversion fails

This commit is contained in:
Jasha Droppo 2014-11-07 18:25:00 -08:00
Родитель 3dbabb6c29
Коммит 3369f5eaec
1 изменённых файлов: 5 добавлений и 1 удалений

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

@ -386,7 +386,11 @@ namespace Microsoft { namespace MSR { namespace CNTK {
Matrix<ElemType> A = ReadMatrixFromDbnFile(fstream,std::string("b"));
if (wts.GetNumRows()!=m_layerSizes[i+1] || wts.GetNumCols()!=m_layerSizes[i])
{
throw std::runtime_error("error reading DBN file: mismatch in layer size between dbn file and config specification!\n");
std::stringstream msg;
msg << "error reading DBN file: mismatch in layer size between dbn file and config specification!" << endl;
msg << wts.GetNumRows() << "," << wts.GetNumCols() << "!=" << m_layerSizes[i + 1] << "," << m_layerSizes[i] << endl;
throw std::runtime_error(msg.str().c_str());
}
if (i==0)
{