【发布时间】:2020-10-22 06:49:10
【问题描述】:
我正在尝试运行this app,这是一个对象检测应用程序。该应用使用 Tensorflow-Lite。
尝试运行此应用时出现错误
Unresolved reference: setUseNNAPI
对于这些行
override fun setUseNNAPI(isChecked: Boolean) {
if (tfLite != null) tfLite!!.setUseNNAPI(isChecked)
}
找不到tfLite!!.setUseNNAPI(isChecked) 的引用。这个函数应该以某种方式连接到Interpreter 选项,但这些是在create 方法中设置的:
@Throws(IOException::class)
fun create(
assetManager: AssetManager,
modelFilename: String,
labelFilename: String,
inputSize: Int,
isQuantized: Boolean): Classifier {
...
try {
val options = Interpreter.Options()
options.setNumThreads(4)
options.setUseNNAPI(false)
d.tfLite = Interpreter(loadModelFile(assetManager, modelFilename), options)
} catch (e: Exception) {
throw RuntimeException(e)
}
有人知道发生了什么吗?
【问题讨论】:
标签: android android-studio tensorflow kotlin tensorflow-lite