Skip to content

Unresolved reference: tensorflow #48

@HansBambel

Description

@HansBambel

I am trying to use tensorflow lite to run a tflite model, but after adding this to the dependencies and syncing gradle

    implementation("com.google.ai.edge.litert:litert:1.0.1")
    implementation("com.google.ai.edge.litert:litert-support:1.0.1")

tensorflow is not found:

Unresolved reference: tensorflow

This is my file:

import org.tensorflow.lite.Interpreter
import org.tensorflow.lite.support.common.FileUtil
import org.tensorflow.lite.support.metadata.MetadataExtractor

class OutputModel: TensorflowInferenceRunner {
    private val interpreter: Interpreter
    init {
        // Load the TensorFlow Lite model
        val model = FileUtil.loadMappedFile(context, "model.tflite")
        interpreter = Interpreter(model)
    }
}

I also tried with runtimeOnly("org.tensorflow:tensorflow-lite:2.17.0") as dependency, but I get the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions