Open GAOusername opened 8 months ago
I'm facing exactly the same, using the sample android code, unmodified, latest android studio, latest sdk/ndk.
I'm also seeing the "RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iterate_calculator.cc:237" , however in that line 237 what i see is "config.lora_weights_layer_mapping = !lora_weights_layer_mapping.empty()" which doesn't seem related to image size?
com...pipe.examples.imagegeneration E E0000 00:00:1717663845.377968 28262 diffuser_gpu.cc:88] UNKNOWN: Failed to create 2D texture (clCreateImage): Invalid image size --------- beginning of crash 2024-06-06 14:20:45.378 28153-28257 native com...pipe.examples.imagegeneration E E0000 00:00:1717663845.378146 28257 calculator_graph.cc:887] INTERNAL: CalculatorGraph::Run() failed: Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iteratecalculator.cc:253) context 2024-06-06 14:20:45.392 28153-28257 AndroidRuntime com...pipe.examples.imagegeneration E FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: com.google.mediapipe.examples.imagegeneration, PID: 28153 com.google.mediapipe.framework.MediaPipeException: internal: CalculatorGraph::Run() failed: Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iteratecalculator.cc:253) context at com.google.mediapipe.framework.Graph.nativeWaitUntilGraphIdle(Native Method) at com.google.mediapipe.framework.Graph.waitUntilGraphIdle(Graph.java:471) at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:74) at com.google.mediapipe.tasks.vision.imagegenerator.ImageGenerator.createFromOptions(ImageGenerator.java:167) at com.google.mediapipe.tasks.vision.imagegenerator.ImageGenerator.createFromOptions(ImageGenerator.java:96) at com.google.mediapipe.examples.imagegeneration.ImageGenerationHelper.initializeImageGenerator(ImageGenerationHelper.kt:32) at com.google.mediapipe.examples.imagegeneration.diffusion.DiffusionViewModel$initializeImageGenerator$3.invokeSuspend(DiffusionViewModel.kt:66) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@547731d, Dispatchers.Default]
I have the same error on qcom 8650 GPU Andero 750 2024-07-04 03:25:12.014 28876-28876 ImeTracker I com.google.mediapipe.examples.imagegeneration:46fa34ee: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT 2024-07-04 03:25:12.084 28876-28956 native I I0000 00:00:1720034712.083933 28956 diffuser.cc:81] Environment created 2024-07-04 03:25:14.138 28876-28956 native I I0000 00:00:1720034714.138813 28956 diffuser.cc:89] TextGuidance is created 2024-07-04 03:25:14.152 28876-28956 native I I0000 00:00:1720034714.151973 28956 diffuser.cc:94] Copier is created 2024-07-04 03:25:31.105 28876-28956 native E E0000 00:00:1720034731.105563 28956 diffuser_gpu.cc:88] UNKNOWN: Failed to create 2D texture (clCreateImage): Invalid image size 2024-07-04 03:25:31.106 28876-28953 native E E0000 00:00:1720034731.106050 28953 calculator_graph.cc:887] INTERNAL: CalculatorGraph::Run() failed: Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iteratecalculator.cc:248) context 2024-07-04 03:25:31.128 28876-28953 AndroidRuntime E FATAL EXCEPTION: DefaultDispatcher-worker-1 Process: com.google.mediapipe.examples.imagegeneration, PID: 28876 com.google.mediapipe.framework.MediaPipeException: internal: CalculatorGraph::Run() failed: Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iteratecalculator.cc:248) context at com.google.mediapipe.framework.Graph.nativeWaitUntilGraphIdle(Native Method) at com.google.mediapipe.framework.Graph.waitUntilGraphIdle(Graph.java:464) at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:74) at com.google.mediapipe.tasks.vision.imagegenerator.ImageGenerator.createFromOptions(ImageGenerator.java:167) at com.google.mediapipe.tasks.vision.imagegenerator.ImageGenerator.createFromOptions(ImageGenerator.java:96) at com.google.mediapipe.examples.imagegeneration.ImageGenerationHelper.initializeImageGenerator(ImageGenerationHelper.kt:32) at com.google.mediapipe.examples.imagegeneration.diffusion.DiffusionViewModel$initializeImageGenerator$3.invokeSuspend(DiffusionViewModel.kt:66) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@8c43678, Dispatchers.Default]
Every time we click to perform mediapipe initialization, the application crashes and cannot proceed to the next step.
02-05 00:42:40.769 5344 5390 E native : E0000 00:00:1675575760.764098 5390 diffuser_gpu.cc:88] UNKNOWN: Failed to create 2D texture (clCreateImage): Invalid image size 02-05 00:42:40.821 5344 5384 E native : E0000 00:00:1675575760.820843 5384 calculator_graph.cc:875] INTERNAL: CalculatorGraph::Run() failed: 02-05 00:42:40.821 5344 5384 E native : Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iterate_calculator.cc:237) context_ --------- beginning of crash 02-05 00:42:41.018 5344 5384 E AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1 02-05 00:42:41.018 5344 5384 E AndroidRuntime: Process: com.google.mediapipe.examples.imagegeneration, PID: 5344 02-05 00:42:41.018 5344 5384 E AndroidRuntime: com.google.mediapipe.framework.MediaPipeException: internal: CalculatorGraph::Run() failed: 02-05 00:42:41.018 5344 5384 E AndroidRuntime: Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iterate_calculator.cc:237) context_ 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.framework.Graph.nativeWaitUntilGraphIdle(Native Method) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.framework.Graph.waitUntilGraphIdle(Graph.java:464) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:74) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.tasks.vision.imagegenerator.ImageGenerator.createFromOptions(ImageGenerator.java:167) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.tasks.vision.imagegenerator.ImageGenerator.createFromOptions(ImageGenerator.java:96) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.examples.imagegeneration.ImageGenerationHelper.initializeImageGenerator(ImageGenerationHelper.kt:32) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.examples.imagegeneration.diffusion.DiffusionViewModel$initializeImageGenerator$3.invokeSuspend(DiffusionViewModel.kt:66) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@1ccbaa6, Dispatchers.Default] 02-05 00:42:41.052 1436 2787 I am_crash: [5344,0,com.google.mediapipe.examples.imagegeneration,551075398,com.google.mediapipe.framework.MediaPipeException,internal: CalculatorGraph::Run() failed: 02-05 00:42:41.052 1436 2787 I am_crash: Calculator::Open() for node "mediapipe_tasks_vision_image_generator_imagegeneratorgraph__StableDiffusionIterateCalculator" failed: ; RET_CHECK failure (mediapipe/tasks/cc/vision/image_generator/diffuser/stable_diffusion_iterate_calculator.cc:237) context_,Graph.java,-2] 02-05 00:42:41.085 1436 5680 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 02-05 00:42:41.102 1436 2787 W ActivityTaskManager: Force finishing activity com.google.mediapipe.examples.imagegeneration/.diffusion.DiffusionActivity 02-05 00:42:41.105 1436 2787 I wm_finish_activity: [0,31900940,17,com.google.mediapipe.examples.imagegeneration/.diffusion.DiffusionActivity,force-crash]
After displaying the log in the underlying graphics-related so library, we can see that the Mediapipe application passes image_height = 17280, and the maximum supported height is 16384. We also use the clGetDeviceInfo API to query the maximum supported image width and height which is 16384.'com.google.mediapipe:tasks-vision-image-generator:0.10.5.2' is not open source, so I don't know the cause of the crash :
2-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.framework.Graph.nativeWaitUntilGraphIdle(Native Method) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.framework.Graph.waitUntilGraphIdle(Graph.java:464) 02-05 00:42:41.018 5344 5384 E AndroidRuntime: at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:74)
So I want to know what image_height is set based on when mediapipe is initialized? Why is image_height = 17280 set, which is larger than the supported maximum value of 16384?