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

java.lang.ArrayIndexOutOfBoundsException occured when I run the android sample with model SSDMobileNet-V2 #427

Open
libofei2004 opened this issue Aug 3, 2024 · 0 comments

Comments

@libofei2004
Copy link

I have downloaded the models on the page https://ai.google.dev/edge/mediapipe/solutions/vision/object_detector?hl=zh-cn, includes EfficientDet-Lite0 (int8) and SSDMobileNet-V2 (int8) , then I run the android sample object_detection download from https://github.com/google-ai-edge/mediapipe-samples. I can successfully run EfficientDet-Lite0 (int8), but when I run SSDMobileNet-V2 (int8), an error occued.

com...pipe.examples.objectdetection E FATAL EXCEPTION: main
Process: com.google.mediapipe.examples.objectdetection, PID: 8721
java.lang.ArrayIndexOutOfBoundsException: length=2; index=4
at java.util.Arrays$ArrayList.get(Arrays.java:3766)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:394)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:450)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:416)
at android.widget.Spinner.makeView(Spinner.java:724)
at android.widget.Spinner.layout(Spinner.java:672)
at android.widget.AbsSpinner.setSelectionInt(AbsSpinner.java:308)
at android.widget.AbsSpinner.setSelection(AbsSpinner.java:285)
at com.google.mediapipe.examples.objectdetection.fragments.CameraFragment.initBottomSheetControls(CameraFragment.kt:222)
at com.google.mediapipe.examples.objectdetection.fragments.CameraFragment.onViewCreated(CameraFragment.kt:151)
at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3128)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:552)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1899)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1823)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2985)
at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2902)
at androidx.fragment.app.Fragment.performStart(Fragment.java:3171)
at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:588)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:279)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1433)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2977)
at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2902)
at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:274)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:359)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
at android.app.Activity.performStart(Activity.java:8273)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3788)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2288)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8293)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant