FaceRecognition_With_FaceNet_Android
FaceRecognition_With_FaceNet_Android copied to clipboard
Internal error: Failed to apply delegate with GpuDelegate
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8387)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
Caused by: java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: ModifyGraphWithDelegate is disallowed when graph is immutable.
at org.tensorflow.lite.NativeInterpreterWrapper.applyDelegate(Native Method)
at org.tensorflow.lite.NativeInterpreterWrapper.applyDelegates(NativeInterpreterWrapper.java:373)
at org.tensorflow.lite.NativeInterpreterWrapper.init(NativeInterpreterWrapper.java:85)
at org.tensorflow.lite.NativeInterpreterWrapper.
private val useGpu = true private val useXNNPack = true private val modelInfo = Models.FACENET_QUANTIZED
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
Caused by: java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Following operations are not supported by GPU delegate:
FULLY_CONNECTED: Max version supported: 4. Requested version 9.
180 operations will run on the GPU, and the remaining 1 operations will run on the CPU.
ModifyGraphWithDelegate is disallowed when graph is immutable.
at org.tensorflow.lite.NativeInterpreterWrapper.applyDelegate(Native Method)
at org.tensorflow.lite.NativeInterpreterWrapper.applyDelegates(NativeInterpreterWrapper.java:373)
at org.tensorflow.lite.NativeInterpreterWrapper.init(NativeInterpreterWrapper.java:85)
at org.tensorflow.lite.NativeInterpreterWrapper.<init>(NativeInterpreterWrapper.java:63)
at org.tensorflow.lite.Interpreter.<init>(Interpreter.java:277)
at com.ml.quaterion.facenetdetection.model.FaceNetModel.<init>(FaceNetModel.kt:73)
at com.ml.quaterion.facenetdetection.MainActivity.onCreate(MainActivity.kt:122)
at android.app.Activity.performCreate(Activity.java:8121)
at android.app.Activity.performCreate(Activity.java:8109)
private val useGpu = true private val useXNNPack = true private val modelInfo = Models.FACENET
I face this error too, but if i comment "setUseNNAPI(true)" in FaceNetModel class this error gone, I using android with API 31
@denny-zefanya Let me look into the error closely. It seems to be an incompatibility of TF ops with the GpuDelegate
.