mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

0.10.10 Holistic GPU delegation does not work

Open clemenshimmer opened this issue 1 year ago • 14 comments

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

Ubuntu 22.04.3 LTS

MediaPipe Tasks SDK version

0.10.10

Task name (e.g. Image classification, Gesture recognition etc.)

Holistic Landmarker

Programming Language and version (e.g. C++, Python, Java)

JS WASM API

Describe the actual behavior

Task cannot run when GPU delegation is turned on

Describe the expected behaviour

Tasks runs with GPU delegation turned on

Standalone code/steps you may have used to try to get what you need

https://codepen.io/clemenshimmer/pen/rNREezm

To break the behaviour, simply uncomment the GPU delegation option.

Other info / Complete Logs

I tried to get the just released 0.10.10 holistic landmarker to run, as mentioned in the release notes:

Javascript Add Holistic Landmarker Web API

I've been a tiny bit cheeky and just walked back the path of the face landmarker task file linked in the docs until I landed on https://storage.googleapis.com/mediapipe-models/ which gave me the contents in a searchable XML file, that's how I found https://storage.googleapis.com/mediapipe-models/holistic_landmarker/holistic_landmarker/float16/latest/holistic_landmarker.task and just used it as the TS API suggested to. That seems to work, but only if GPU delegation is turned off, once it is turned back on the following error is thrown.

Run error (stack traces truncated)
Following operations are not supported by GPU delegate:

DEQUANTIZE: 

STRIDED_SLICE: Slice does not support shrink_axis_mask parameter. 

123 operations will run on the GPU, and the remaining 59 operations will run on the CPU.

E0223 11:50:16.711000 1927856 calculator_graph.cc:892] UNIMPLEMENTED: CalculatorGraph::Run() failed: 
Calculator::Open() for node "mediapipe_tasks_vision_holistic_landmarker_holisticlandmarkergraph__mediapipe_tasks_vision_face_landmarker_faceblendshapesgraph__mediapipe_tasks_core_inferencesubgraph__inferencecalculator__mediapipe_tasks_vision_holistic_landmarker_holisticlandmarkergraph__mediapipe_tasks_vision_face_landmarker_faceblendshapesgraph__mediapipe_tasks_core_inferencesubgraph__InferenceCalculator" failed: No support of const
=== Source Location Trace: ===
third_party/ml_drift/gl30/inference_context.cc:814
third_party/ml_drift/gl30/inference_context.cc:984
third_party/ml_drift/gl30/inference_context.cc:919
blaze-out/wasm-opt-ST-41541f88f73d/genfiles/third_party/mediapipe/calculators/tensor/inference_calculator_ml_drift_webgl_obfuscated.cc:288
blaze-out/wasm-opt-ST-41541f88f73d/genfiles/third_party/mediapipe/calculators/tensor/inference_calculator_ml_drift_webgl_obfuscated.cc:489
blaze-out/wasm-opt-ST-41541f88f73d/genfiles/third_party/mediapipe/calculators/tensor/inference_calculator_ml_drift_webgl_obfuscated.cc:119
third_party/mediapipe/framework/calculator_node.cc:560

Originally I recieved this error, but it seems this is some kind of error on my end as the minimal reproduction works - at least with GPU delegation disabled.

Initialization error (stack traces truncated)
No registered object with name: mediapipe::tasks::vision::holistic_landmarker::HolisticLandmarkerGraph; Unable to find Calculator "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"; Initialize was not ok [type.googleapis.com/mediapipe.StatusList='\n\xcb\x01\x08\x05\x12\xc6\x01No registered object with name: mediapipe::tasks::vision::holistic_landmarker::HolisticLandmarkerGraph; Unable to find Calculator \"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph\"']
=== Source Location Trace: === 
./third_party/mediapipe/framework/deps/registration.h:218
third_party/mediapipe/framework/validated_graph_config.cc:230
third_party/mediapipe/framework/validated_graph_config.cc:350
third_party/mediapipe/framework/calculator_graph.cc:454
research/drishti/app/pursuit/wasm/graph_utils.cc:87

ERROR Error: Uncaught (in promise): Error: ValidatedGraphConfig Initialization failed.
No registered object with name: mediapipe::tasks::vision::holistic_landmarker::HolisticLandmarkerGraph; Unable to find Calculator "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"; Initialize was not ok; StartGraph failed
Error: ValidatedGraphConfig Initialization failed.
No registered object with name: mediapipe::tasks::vision::holistic_landmarker::HolisticLandmarkerGraph; Unable to find Calculator "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"; Initialize was not ok; StartGraph failed
  at Wo (vision_bundle.mjs:1:44941)
  at wh.setGraph (vision_bundle.mjs:1:46735)
  at wh.m (vision_bundle.mjs:1:118111)
  at vision_bundle.mjs:1:46413
  at _ZoneDelegate.invoke (zone.js:368:26)
  at Object.onInvoke (core.mjs:11083:33)
  at _ZoneDelegate.invoke (zone.js:367:52)
  at Zone.run (zone.js:129:43)
  at zone.js:1257:36
  at _ZoneDelegate.invokeTask (zone.js:402:31)
  at resolvePromise (zone.js:1193:31)
  at zone.js:1100:17
  at zone.js:1116:33
  at asyncGeneratorStep (asyncToGenerator.js:6:1)
  at _throw (asyncToGenerator.js:25:1)
  at _ZoneDelegate.invoke (zone.js:368:26)
  at Object.onInvoke (core.mjs:11083:33)
  at _ZoneDelegate.invoke (zone.js:367:52)
  at Zone.run (zone.js:129:43)
  at zone.js:1257:36

clemenshimmer avatar Feb 23 '24 12:02 clemenshimmer

I can confirm the same issue. Holistic landmark works only if GPU delegation is disabled.

ButzYung avatar Feb 23 '24 14:02 ButzYung

Hello @ButzYung and @clemenshimmer Thanks for filing this issue. We have escalated this issue to the concerned team developing the JS APIs for MediaPipe. The issue is being investigated.

ayushgdev avatar Feb 29 '24 04:02 ayushgdev

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Mar 08 '24 01:03 github-actions[bot]

still a problem with new 0.10.11

Bildschirmfoto vom 2024-03-08 18-15-12

arpu avatar Mar 08 '24 17:03 arpu

Still seeing the same issue in 0.10.12. Screenshot 2024-04-06 at 11 09 11

Wei-1 avatar Apr 06 '24 03:04 Wei-1

@schmidt-sebastian anything we can try/help?

arpu avatar Apr 10 '24 21:04 arpu

seeing the same issue in 0.10.13rc.

image

MuhammadAasharibNawshad avatar May 01 '24 06:05 MuhammadAasharibNawshad

Unfortunately GPU delegation is still not working on the latest v0.10.13. I wonder if there is a roadmap on when GPU will be supported on Holistic Web. Without GPU, web solution is barely usable for any real-time application.

ButzYung avatar May 08 '24 08:05 ButzYung

Just tested with v0.10.15, the GPU support for Holistic Web is still not working. Edit: in WebWorker

Wei-1 avatar Sep 01 '24 07:09 Wei-1

With 0.10.15 and 0.10.16, Holistic Web runs without error and the GPU delegation actually works, FPS increased from below 10 to 15? demo: https://mikapo.amyang.dev

AmyangXYZ avatar Sep 23 '24 18:09 AmyangXYZ

With 0.10.15 and 0.10.16, Holistic Web runs without error and the GPU delegation actually works, FPS increased from below 10 to 15? demo: https://mikapo.amyang.dev

The FPS is above 20 judging from your demo. CPU-only Holistic was hardly over 10 in my own previous tests, so I bet GPU is working.

PS: Well it seems it still doens't work in my app (using 0.10.15, GPU delegation on but with the same errors as before)? Is there something special regarding your Holistic setup?

ButzYung avatar Sep 24 '24 09:09 ButzYung

With 0.10.15 and 0.10.16, Holistic Web runs without error and the GPU delegation actually works, FPS increased from below 10 to 15? demo: https://mikapo.amyang.dev

The FPS is above 20 judging from your demo. CPU-only Holistic was hardly over 10 in my own previous tests, so I bet GPU is working.

PS: Well it seems it still doens't work in my app (using 0.10.15, GPU delegation on but with the same errors as before)? Is there something special regarding your Holistic setup?

Nothing special actually, https://github.com/AmyangXYZ/MiKaPo/blob/261fd2b9229a99488e66d6790c9120ad8e053aab/src/Video.tsx#L181-L265

AmyangXYZ avatar Sep 26 '24 02:09 AmyangXYZ