赞
踩
最近在做深度学习的项目,onnx用c#程序部署。
然后发现在部署/移植模型的时候遇到了一个问题,找了很多资料都没解决
还得亲自动手了
- 报错弹窗内容
- System.TypeInitializationException:“The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.”
- EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'.
各种测试以后发现是程序包的问题
解决办法是移除掉项目中已经有的microsoft.ml.onnxruntime包,自己重新安装,即可。
步骤1:包名上右击--》移除,即可删除
步骤2:项目上右击-->管理nuget程序包,打开nuget功能
步骤3:浏览框输入microsoft.ml.onnxruntime进行搜索,选择第一安装即可,安装完以后,再次运行项目的时候就不报错了。
【链接:https://pan.baidu.com/s/1eeewmblZVQ2WWsqqJQwdCw?pwd=1234
项目代码来自:冰凌呀
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。