-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Hello. I am trying to use weights for each class. When i call
double[] testResults = testSet.Predict(model);
The error happens inside SVMModel.Free(ptr_model);
public static double[] Predict(this SVMProblem problem, SVMModel model)
{
IntPtr ptr_model = SVMModel.Allocate(model);
double[] target = problem.X.Select(x => x.Predict(ptr_model)).ToArray();
SVMModel.Free(ptr_model);
return target;
}
inside
SVMModel.Free(x);
inside
SVMParameter.Free(x.param);
It causes error at this function
public static void Free(svm_parameter x)
{
Marshal.FreeHGlobal(x.weight);
x.weight = IntPtr.Zero;
Marshal.FreeHGlobal(x.weight_label);
x.weight_label = IntPtr.Zero;
}
The error giving line is :
Marshal.FreeHGlobal(x.weight);
Even in debug mode i don't get any particular error.
Metadata
Metadata
Assignees
Labels
No labels