Skip to content

bad_alloc when running demo #9

@Stack-it-up

Description

@Stack-it-up

Hello and thanks for the repo.

It was quite hard to get it to work, especially since mediapipe discontinued support for bazel<3.7 but now I'm encountering another problem.

Description: When running the demo the counter gets to 60, then after a while the program closes without ever showing a prediction. The webcam windows opens correctly and shows video input.
Full log:
./run_prediction.sh
I20210331 23:14:38.518226 12906 demo_run_graph_main_gpu.cc:51] Get calculator graph config contents: # Images coming into and out of the graph.
input_stream: "input_video"
output_stream: "output_video"

node {
calculator: "ConstantSidePacketCalculator"
output_side_packet: "PACKET:file_path"
options: {
[mediapipe.ConstantSidePacketCalculatorOptions.ext]: {
packet { string_value: "models/sign_lang_label_map.txt" }
}
}
}

node {
calculator: "LocalFileContentsCalculator"
input_side_packet: "FILE_PATH:file_path"
output_side_packet: "CONTENTS:contents"
}

node {
calculator: "FlowLimiterCalculator"
input_stream: "input_video"
input_stream: "FINISHED:multi_hand_landmarks"
input_stream_info: {
tag_index: "FINISHED"
back_edge: true
}
output_stream: "throttled_input_video"
}

node {
calculator: "DetectionsGPUSubgraph"
input_stream: "throttled_input_video"
output_stream: "output_detections"
output_stream: "multi_hand_landmarks"
output_stream: "detection_render_data"
output_stream: "multi_hand_rects_render_data"
output_stream: "multi_palm_rects_render_data"
output_stream: "render_data"
output_stream: "multi_hand_landmarks_render_data"
}

node {
calculator: "SignLangPredictionCalculator"
input_side_packet: "LABELS:contents"
input_stream: "DETECTIONS:output_detections"
input_stream: "NORM_LANDMARKS:multi_hand_landmarks"
output_stream: "prediction"
options {
[signlang.SignLangPredictionCalculatorOptions.ext] {
verbose: false
framesWindowSize: 60
thresholdFramesCount: 5
minFramesForInference: 20
use3D: false
useRelative: false
probabilityThreshold: 0.5
fluentPrediction: false
tfLiteModelPath: "models/sign_lang_recognition_2D.tflite"
}
}
}

node {
calculator: "SentenizerCalculator"
input_stream: "prediction"
output_stream: "sentence"
}

node {
calculator: "ImagePropertiesCalculator"
input_stream: "IMAGE_GPU:input_video"
output_stream: "SIZE:image_size"
}

node {
calculator: "TextToRenderDataCalculator"
input_stream: "TEXT:sentence"
input_stream: "SIZE:image_size"
output_stream: "RENDER_DATA:0:background_rect"
output_stream: "RENDER_DATA:1:text_render_data"
}

node {
calculator: "AnnotationOverlayCalculator"
input_stream: "IMAGE_GPU:throttled_input_video"
input_stream: "render_data"
input_stream: "background_rect"
input_stream: "text_render_data"
input_stream: "VECTOR:0:multi_hand_landmarks_render_data"
output_stream: "IMAGE_GPU:output_video"
}
I20210331 23:14:38.518961 12906 demo_run_graph_main_gpu.cc:57] Initialize the calculator graph.
I20210331 23:14:38.522275 12906 demo_run_graph_main_gpu.cc:61] Initialize the GPU.
I20210331 23:14:38.532456 12906 gl_context_egl.cc:158] Successfully initialized EGL. Major : 1 Minor: 4
I20210331 23:14:38.535378 12920 gl_context.cc:324] GL version: 3.1 (OpenGL ES 3.1 Mesa 20.0.8)
I20210331 23:14:38.535461 12906 demo_run_graph_main_gpu.cc:67] Initialize the camera or load the video.
I20210331 23:14:38.870782 12906 demo_run_graph_main_gpu.cc:88] Start running the calculator graph.
I20210331 23:14:38.874580 12906 demo_run_graph_main_gpu.cc:93] Start grabbing and processing frames.
INFO: Created TensorFlow Lite delegate for GPU.
I20210331 23:14:39.423686 12920 gl_context.cc:807] Found unchecked GL error: GL_INVALID_FRAMEBUFFER_OPERATION
W20210331 23:14:39.423763 12920 gl_context.cc:828] Ignoring unchecked GL error.
E20210331 23:14:51.853036 12913 sign_lang_prediction_calculator.cc:366] Coordinates size not equal 86. Actual size: 128
E20210331 23:14:51.936754 12909 sign_lang_prediction_calculator.cc:366] Coordinates size not equal 86. Actual size: 128
E20210331 23:14:52.019819 12908 sign_lang_prediction_calculator.cc:366] Coordinates size not equal 86. Actual size: 128
E20210331 23:14:52.103752 12910 sign_lang_prediction_calculator.cc:366] Coordinates size not equal 86. Actual size: 128
E20210331 23:14:52.186794 12915 sign_lang_prediction_calculator.cc:366] Coordinates size not equal 86. Actual size: 128
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
./run_prediction.sh: line 1: 12906 Aborted (core dumped) GLOG_logtostderr=1 bazel-bin/app/prediction_gpu --calculator_graph_config_file=graphs/sign_lang_prediction_gpu.pbtxt`

System info:
`Ubuntu 18.04 (kernel 4.15.0-140-generic )
Python 3.6.9
Mediapipe 3.4.1
Mesa 20.0.8
GLX version: 1.4
OpenGL:
Max core profile version: 4.5
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1

GPU nvidia GT740m`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions