C# onnxruntime-导入时导出scikit RandomForestClassifier失败
我已经使用WinMLTools将scikit RandomForestClassifier模型导出到ONNX。 当我尝试使用ONNXRuntime(在C#上)导入文件时。我得到以下错误:C# onnxruntime-导入时导出scikit RandomForestClassifier失败,c#,scikit-learn,random-forest,onnx,onnxruntime,C#,Scikit Learn,Random Forest,Onnx,Onnxruntime,我已经使用WinMLTools将scikit RandomForestClassifier模型导出到ONNX。 当我尝试使用ONNXRuntime(在C#上)导入文件时。我得到以下错误: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' 这发生在第二个输出名称(“概率”)
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
这发生在第二个输出名称(“概率”)传递给:
NativeMethods.OrtCastTypeInfoToTensorInfo(typeInfo)
结果是IntPtr的地址为0x000000000
输入参数和第一个输出参数按计划运行
该模型的输出是一个浮点数组,所以我不明白可能是什么问题
完整调用堆栈:
at Microsoft.ML.OnnxRuntime.NativeMethods.OrtGetTensorElementType(IntPtr typeAndShapeInfo)
at Microsoft.ML.OnnxRuntime.InferenceSession.GetMetadataFromTypeInfo(IntPtr typeInfo) in C:\agent\_work\7\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.cs:line 305
onnx文件的大小是多少?“出口成功了,不是腐败了吗?”维维克库马尔在KB附近问道。导出过程中没有错误/警告。我还可以在python中导入它,所以我想它没有损坏。嗨,我是onnxruntime的开发人员。对于C#,这是当时我们还没有实现的东西。很抱歉给您带来不便。你能再试一次最新版本吗?我猜它已经被修复了,onnx文件的大小是多少?“出口成功了,不是腐败了吗?”维维克库马尔在KB附近问道。导出过程中没有错误/警告。我还可以在python中导入它,所以我想它没有损坏。嗨,我是onnxruntime的开发人员。对于C#,这是当时我们还没有实现的东西。很抱歉给您带来不便。你能再试一次最新版本吗?我想它已经修好了