Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# onnxruntime-导入时导出scikit RandomForestClassifier失败_C#_Scikit Learn_Random Forest_Onnx_Onnxruntime - Fatal编程技术网

C# onnxruntime-导入时导出scikit RandomForestClassifier失败

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.' 这发生在第二个输出名称(“概率”)

我已经使用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.'
这发生在第二个输出名称(“概率”)传递给:

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#,这是当时我们还没有实现的东西。很抱歉给您带来不便。你能再试一次最新版本吗?我想它已经修好了