Hadji Musaev
11/04/2021, 4:04 PMnoCompress
option. I’m trying to load a tensorflow lite model from assets in tests following this standard approach: https://www.tensorflow.org/lite/inference_with_metadata/lite_support
Here’s a minimal version of the test that fails:
@RunWith(RobolectricTestRunner::class)
class MyTest {
lateinit var interpreter: Interpreter
@Before
fun setUp() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val tfliteModel = FileUtil.loadMappedFile(context, "model.tflite")
interpreter = Interpreter(tfliteModel)
}
When I run it, it outputs java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
. However, I specified this in my gradle.build inside the android{}
entry:
aaptOptions {
noCompress("tflite")
}
What could I be doing wrong?
P.S. I apologise if this problem is not KMP specific 😅Hadji Musaev
11/04/2021, 4:33 PM