Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal error: Failed to apply delegate with GpuDelegate #29

Open
ruirui1128 opened this issue Sep 9, 2022 · 3 comments
Open

Internal error: Failed to apply delegate with GpuDelegate #29

ruirui1128 opened this issue Sep 9, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@ruirui1128
Copy link

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.(NativeInterpreterWrapper.java:63)
at org.tensorflow.lite.Interpreter.(Interpreter.java:277)
at com.ml.quaterion.facenetdetection.model.FaceNetModel.(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_QUANTIZED

@ruirui1128
Copy link
Author

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

@shubham0204 shubham0204 added the bug Something isn't working label Sep 9, 2022
@shubham0204 shubham0204 changed the title has crash Internal error: Failed to apply delegate with GpuDelegate Sep 9, 2022
@shubham0204 shubham0204 changed the title Internal error: Failed to apply delegate with GpuDelegate Internal error: Failed to apply delegate with GpuDelegate Sep 9, 2022
@denny-zefanya
Copy link

I face this error too, but if i comment "setUseNNAPI(true)" in FaceNetModel class this error gone, I using android with API 31

@shubham0204
Copy link
Owner

@denny-zefanya Let me look into the error closely. It seems to be an incompatibility of TF ops with the GpuDelegate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants