You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have created an svmregressor using sklearn and skl2onnx:
initial_type = [('double_input', DoubleTensorType([None, len(d)]))]
onx = convert_sklearn(results[i].estimator_, initial_types=initial_type)
with open(r"C:\my folder\x_" + str(i) + "_1.onnx", "wb") as f:
f.write(onx.SerializeToString())
I call it in c# using
session = new InferenceSession(modelPath);
modelInputNames = session.InputMetadata.Keys.Single();
dimensions = new int[] { 1, X.Length };
DenseTensor<double> inputTensor = new DenseTensor<double>(X, dimensions);
List<NamedOnnxValue> modelInput = new List<NamedOnnxValue>
{
NamedOnnxValue.CreateFromTensor(modelInputNames, inputTensor)
};
var result = session.Run(modelInput);
var prediction = ((DenseTensor<double>)result.Single().Value).ToArray();
and I get the error in:
class NativeApiStatus
{
private static string GetErrorMessage(IntPtr /*(ONNXStatus*)*/status)
{
// nativeString belongs to status, no need for separate release
IntPtr nativeString = NativeMethods.OrtGetErrorMessage(status);
return NativeOnnxValueHelper.StringFromNativeUtf8(nativeString);
}
/// <summary>
/// Checks the native Status if the errocode is OK/Success. Otherwise constructs an appropriate exception and throws.
/// Releases the native status object, as needed.
/// </summary>
/// <param name="nativeStatus"></param>
/// <throws></throws>
public static void VerifySuccess(IntPtr nativeStatus)
{
if (nativeStatus != IntPtr.Zero)
{
try
{
ErrorCode statusCode = NativeMethods.OrtGetErrorCode(nativeStatus);
string errorMessage = GetErrorMessage(nativeStatus);
}
finally
{
NativeMethods.OrtReleaseStatus(nativeStatus);
}
}
}
}
I get this error:
Microsoft.ML.OnnxRuntime.OnnxRuntimeException
HResult=0x80131500
Message=[ErrorCode:NotImplemented] Could not find an implementation for SVMRegressor(1) node with name 'SVM'
Source=Microsoft.ML.OnnxRuntime
StackTrace:
at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\NativeApiStatus.cs:line 31
at Microsoft.ML.OnnxRuntime.InferenceSession.Init(String modelPath, SessionOptions options, PrePackedWeightsContainer prepackedWeightsContainer) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.cs:line 776
at Microsoft.ML.OnnxRuntime.InferenceSession..ctor(String modelPath) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.cs:line 59
at OpenQuant.MyStrategy.Volatility(Price price) in C:\Users\b1uce\OneDrive\Documents\OpenQuant 2014\Solutions\Full_6_iq_test_4\MyStrategy\MyStrategy.cs:line 1571
at OpenQuant.MyStrategy.OnBar(Bar bar) in C:\Users\b1uce\OneDrive\Documents\OpenQuant 2014\Solutions\Full_6_iq_test_4\MyStrategy\MyStrategy.cs:line 931
at SmartQuant.Strategy_.Strategy_.D44Vr03dlii(Bar bar)
at SmartQuant.Strategy_.StrategyManager_.f7Z8p42UPH(Bar )
at SmartQuant.EventManager.CxVPNp1OWI(Event )
at SmartQuant.EventManager.OnEvent(Event e)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have created an svmregressor using sklearn and skl2onnx:
I call it in c# using
and I get the error in:
I get this error:
Microsoft.ML.OnnxRuntime.OnnxRuntimeException
HResult=0x80131500
Message=[ErrorCode:NotImplemented] Could not find an implementation for SVMRegressor(1) node with name 'SVM'
Source=Microsoft.ML.OnnxRuntime
StackTrace:
at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\NativeApiStatus.cs:line 31
at Microsoft.ML.OnnxRuntime.InferenceSession.Init(String modelPath, SessionOptions options, PrePackedWeightsContainer prepackedWeightsContainer) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.cs:line 776
at Microsoft.ML.OnnxRuntime.InferenceSession..ctor(String modelPath) in D:\a_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.cs:line 59
at OpenQuant.MyStrategy.Volatility(Price price) in C:\Users\b1uce\OneDrive\Documents\OpenQuant 2014\Solutions\Full_6_iq_test_4\MyStrategy\MyStrategy.cs:line 1571
at OpenQuant.MyStrategy.OnBar(Bar bar) in C:\Users\b1uce\OneDrive\Documents\OpenQuant 2014\Solutions\Full_6_iq_test_4\MyStrategy\MyStrategy.cs:line 931
at SmartQuant.Strategy_.Strategy_.D44Vr03dlii(Bar bar)
at SmartQuant.Strategy_.StrategyManager_.f7Z8p42UPH(Bar )
at SmartQuant.EventManager.CxVPNp1OWI(Event )
at SmartQuant.EventManager.OnEvent(Event e)
can you help?
Beta Was this translation helpful? Give feedback.
All reactions