Skip to content

hand_tracking_gpu build successfully but can't run #5593

Open
@qinweisen

Description

@qinweisen

OS Platform and Distribution

Linux Ubuntu 24.04

Compiler version

gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4)

Programming Language and version

C++ 17

Installed using virtualenv? pip? Conda?(if python)

No response

MediaPipe version

0.10.15

Bazel version

6.1.1

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

4.6.0

Describe the problem

I successfully build hand_tracking_gpu, but protobuf threw a fatal error during runtime.

I built hand_tracking_gpu with the following command:

$ bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 mediapipe/examples/desktop/hand_tracking:hand_tracking_gpu

And it returned "INFO: Build completed successfully, 3370 total actions"

But while I tried to run with the following command:

$ GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/hand_tracking/hand_tracking_gpu --calculator_graph_config_file=mediapipe/graphs/hand_tracking/hand_tracking_desktop_live_gpu.pbtxt --input_video_path=input.mp4 --output_video_path=output.mp4

Libprotobuf threw a fatal error, complete logs are as follows.

By the way, I'v already download ".tflite" files and put them in: "mediapipe/modules/hand_landmark" and "mediapipe/modules/palm_detection".

Complete Logs

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1724903246.266829   26469 demo_run_graph_main_gpu.cc:54] Get calculator graph config contents: # MediaPipe graph that performs multi-hand tracking with TensorFlow Lite on GPU.
# Used in the examples in
# mediapipe/examples/android/src/java/com/mediapipe/apps/handtrackinggpu.

# GPU image. (GpuBuffer)
input_stream: "input_video"

# GPU image. (GpuBuffer)
output_stream: "output_video"
# Collection of detected/predicted hands, each represented as a list of
# landmarks. (std::vector<NormalizedLandmarkList>)
output_stream: "hand_landmarks"

# Generates side packet cotaining max number of hands to detect/track.
node {
  calculator: "ConstantSidePacketCalculator"
  output_side_packet: "PACKET:num_hands"
  node_options: {
    [type.googleapis.com/mediapipe.ConstantSidePacketCalculatorOptions]: {
      packet { int_value: 2 }
    }
  }
}

# Detects/tracks hand landmarks.
node {
  calculator: "HandLandmarkTrackingGpu"
  input_stream: "IMAGE:input_video"
  input_side_packet: "NUM_HANDS:num_hands"
  output_stream: "LANDMARKS:hand_landmarks"
  output_stream: "HANDEDNESS:handedness"
  output_stream: "PALM_DETECTIONS:palm_detections"
  output_stream: "HAND_ROIS_FROM_LANDMARKS:hand_rects_from_landmarks"
  output_stream: "HAND_ROIS_FROM_PALM_DETECTIONS:hand_rects_from_palm_detections"
}

# Subgraph that renders annotations and overlays them on top of the input
# images (see hand_renderer_gpu.pbtxt).
node {
  calculator: "HandRendererSubgraph"
  input_stream: "IMAGE:input_video"
  input_stream: "DETECTIONS:palm_detections"
  input_stream: "LANDMARKS:hand_landmarks"
  input_stream: "HANDEDNESS:handedness"
  input_stream: "NORM_RECTS:0:hand_rects_from_palm_detections"
  input_stream: "NORM_RECTS:1:hand_rects_from_landmarks"
  output_stream: "IMAGE:output_video"
}

[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/generated_message_reflection.cc:2933] CHECK failed: file != nullptr:
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: file != nullptr:
Aborted

Metadata

Metadata

Assignees

Labels

legacy:handsHand tracking/gestures/etcos:linux-non-armIssues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices.platform:c++Issues specific to C++ framework in mediapipetype:build/installFor Build and Installation issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions