Vidya_Amar
April 24th, 2004, 05:22 AM
The application which I am working runs fine from the IDE but gives errors when run from outside either from debug or release folders. The following code generates errors:-
NSLearningNetwork nn(DLL_PATH_NAME);
if (nn.IsInitialized())
{
nn.SetNumberOfInputs(m_nInputs);
nn.SetNumberOfOutputs(m_nOutputs);
nn.LoadWeights(m_szWeightsFile);
float * inputData = new float[m_nInputs];
GetNextInputRow(inputData, 1);
float * outputData = new float[m_nOutputs];
nn.GetResponse(NUMBER_OF_EXEMPLARS, inputData, outputData); CString c; c.Format("outputdata=%lf, inputData=%d",*outputData,*inputData);
AfxMessageBox(c);
StoreForecasts(outputData, m_nOutputs);
delete [] inputData; inputData = NULL; delete [] outputData; outputData = NULL;
}
In the above code, outputData value is too large when run from outside but the value is ok when run from the IDE. This generates Arithmetic overflow error when StoreForecasts() function is called.
How to resolve this issue. I am under pressure to solve this problem at the earliest. Hope to find a solution from the forum.
Vidya
NSLearningNetwork nn(DLL_PATH_NAME);
if (nn.IsInitialized())
{
nn.SetNumberOfInputs(m_nInputs);
nn.SetNumberOfOutputs(m_nOutputs);
nn.LoadWeights(m_szWeightsFile);
float * inputData = new float[m_nInputs];
GetNextInputRow(inputData, 1);
float * outputData = new float[m_nOutputs];
nn.GetResponse(NUMBER_OF_EXEMPLARS, inputData, outputData); CString c; c.Format("outputdata=%lf, inputData=%d",*outputData,*inputData);
AfxMessageBox(c);
StoreForecasts(outputData, m_nOutputs);
delete [] inputData; inputData = NULL; delete [] outputData; outputData = NULL;
}
In the above code, outputData value is too large when run from outside but the value is ok when run from the IDE. This generates Arithmetic overflow error when StoreForecasts() function is called.
How to resolve this issue. I am under pressure to solve this problem at the earliest. Hope to find a solution from the forum.
Vidya