我导入了tensorflow lite插件到untiy,我试图整合一个现有的tflite模型到我的脚本,但当我创建对象,我得到了错误
“NullReferenceException:对象引用未设置为对象TensorFlowLite的示例。翻译.ctor(System.Byte[] modelData,TensorFlowLite。InterpreterOptions选项)(位于Packages/com.github.asus4.tflite/Runtime/Interpreter。cs:73)TensorFlowLite。翻译.ctor(System.Byte[] modelData)(位于Packages/com.github.asus4.tflite/Runtime/Interpreter。cs:61)ListenerController。Start()(在Assets/Scripts/ListenerController。cs:27)“
我尝试用不同的方式阅读模型数据,以确保模型正确加载,但这不是问题所在,所以我尝试用不同的方式创建对象的示例,私有,公共和局部变量。
1条答案
按热度按时间qxsslcnc1#
事实证明,在创建对象时,传入InterpreterOptions的可选参数可以正常工作。