mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Error while running Face mesh with Refine Landmark on C++

Open adnan6336 opened this issue 3 years ago • 12 comments

Error while running Face mesh with Refine Landmark = True

System information

  • Have I written custom code (as opposed to using a stock example script provided in Mediapipe): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4): Ubuntu 18.04
  • MediaPipe version: Latest Release i-e 0.8.9
  • Solution (e.g. FaceMesh, Pose, Holistic): FaceMesh
  • Programming Language and version ( e.g. C++, Python, Java): C++

I got an error when running FaceMesh C++ version on GPU with refine landmark = True

Error:0(96) : error C1068: array index out of bonds ...... ERROR: Node number 712 (TfLiteGpuDelegate) failed to prepare ERROR: Restored original execution plan after delegate application failure. ... demo_run_graph_main_gpu.cc:186] Shutting down. Segmentation fault (core dumped).

To reproduce same error,

cd mediapipe

bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 \
  mediapipe/examples/desktop/face_mesh:face_mesh_gpu

GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/face_mesh/face_mesh_gpu \
  --calculator_graph_config_file=mediapipe/graphs/face_mesh/face_mesh_desktop_live_gpu.pbtxt

I have checked the similar issue on #2678 #2797 but they are closed and I can't find any solution. it works on CPU but I need this on GPU and with refine_landmarks as they are much more accurate than the previous one wihtout iris. Any help would be much appreciated. Thanks for this great repo. !

adnan6336 avatar Feb 08 '22 17:02 adnan6336

Hi @adnan6336, As mentioned in this https://github.com/google/mediapipe/issues/2678#issuecomment-989348636 .

  1. Did you try this suggestions, i.e. refine_landmarks = true option actually runs a different ML model (here)
  2. And also try using a snapshot of tensorflow that is closer to the release date of refine_landmarks (Oct 06, 2021)

sgowroji avatar Feb 09 '22 03:02 sgowroji

Hi @adnan6336, As mentioned in this #2678 (comment) .

  1. Did you try this suggestions, i.e. refine_landmarks = true option actually runs a different ML model (here)
  2. And also try using a snapshot of tensorflow that is closer to the release date of refine_landmarks (Oct 06, 2021)

Thank-you for the quick response, The first suggestion is basically the information, I know when setting refine_landmarks = true, it runs different model and so the error while running on GPU and works flawlessly while running on CPU The second suggestion is a bit confusion for me as I don't know how to change the tensorflow version(close to OCT 06,2021) within mediapipe, because I didn't install tensorflow or tensorflow lite seperately as it comes with mediapipe so how do I change that?

adnan6336 avatar Feb 09 '22 07:02 adnan6336

@sgowroji I have also tried mediapipe 0.8.8 version still got same error.

adnan6336 avatar Feb 10 '22 07:02 adnan6336

i am also having same issue in python when running facemesh refined landmarks on GPU. @sgowroji @mcclanahoochie

yayu22 avatar Feb 10 '22 13:02 yayu22

@sgowroji @mcclanahoochie Hi Guys, any direction that I work on?

adnan6336 avatar Feb 14 '22 05:02 adnan6336

@adnan6336, Thank you for being patience. We have shared your request to one of our engineer who will respond on the above query.

sgowroji avatar Feb 21 '22 04:02 sgowroji

did the update in https://github.com/google/mediapipe/issues/2678#issuecomment-1051449676 work?

mcclanahoochie avatar Mar 03 '22 01:03 mcclanahoochie

did the update in #2678 (comment) work?

Thankyou for the reply brother @mcclanahoochie Unfortunately there is no use_advanced_gpu_api: true option in face_landmark_gpu graph

For the reference: face_landmark_gpu.pbtxt

# vector of GPU tensors representing, for instance, detection boxes/keypoints
# and scores.
node {
  calculator: "InferenceCalculator"
  input_stream: "TENSORS:input_tensors"
  input_side_packet: "MODEL:model"
  input_side_packet: "CUSTOM_OP_RESOLVER:op_resolver"
  output_stream: "TENSORS:output_tensors"
  options: {
    [mediapipe.InferenceCalculatorOptions.ext] {
      # Do not remove. Used for generation of XNNPACK/NNAPI graphs.
    }
  }
}

adnan6336 avatar Mar 03 '22 06:03 adnan6336

@mcclanahoochie any update? I still couldn't fix this issue.

adnan6336 avatar Mar 28 '22 13:03 adnan6336

Any updates?

adnan6336 avatar Jun 17 '22 15:06 adnan6336

@mcclanahoochie @sgowroji , kindly let me know if there is anything I can do with this problem. thanks

adnan6336 avatar Jul 13 '22 07:07 adnan6336

any update guys?

adnan6336 avatar Sep 04 '22 14:09 adnan6336

its been over a year this and I am still facing this issue. kindly responsd.

adnan6336 avatar Mar 15 '23 07:03 adnan6336

Hello @adnan6336, We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediapPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.

You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions.

kuaashish avatar Apr 25 '23 12:04 kuaashish

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 May 03 '23 01:05 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar May 11 '23 01:05 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar May 11 '23 01:05 google-ml-butler[bot]

Sorry for the inactivity, but I have tested the new solutions, still facemesh with refine_landmark=True does not work on GPU.

adnan6336 avatar Nov 11 '23 09:11 adnan6336