null 不是对象评估“TfliteReactNative.loadModel”

问题描述

我正在尝试将 tflite-react-native 库集成到我的应用程序中。对于 Android,它运行良好,但对于 iOS,我遇到了这个问题 null is not an object (evaluating 'TfliteReactNative.loadModel')。这是没有将模型文件正确添加到iOS项目的问题吗?但是我使用了所有方法将模型添加到 xcode 项目中,但每次都出现相同的问题。有没有人将这个库与 iOS 集成?

这就是我加载模型的方式

import Tflite from 'tflite-react-native'

let tflite = new Tflite();
tflite.loadModel({
  model:'models/model.tflite',labels:'models/labels.txt',numThreads: 1
},(err,res) => {
    if (err)
      console.log('err');
    else
      console.log('res');
    launchPhotoLib()
  })

这是我的配置

"react-native": "0.64.2","tflite-react-native": "0.0.5"

//Pod
TensorFlowLite 1.13.1

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)