mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

RuntimeError: ValidatedGraphConfig Initialization failed.

Open SlowMonk opened this issue 1 year ago • 2 comments
trafficstars

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

None

OS Platform and Distribution

ubuntu 20.04

MediaPipe Tasks SDK version

'0.10.11'

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

face landmark

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

python

Describe the actual behavior

ImageToTensorCalculator: ; RET_CHECK failure (mediapipe/calculators/tensor/image_to_tensor_calculator.cc:145) kIn(cc).IsConnected() ^ kInGpu(cc).IsConnected()One and only one of IMAGE and IMAGE_GPU input is expected.

Describe the expected behaviour

no pipeline error

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

#GPU image. (GpuBuffer)
input_stream: "IMAGE:image"
# ROI (region of interest) within the given image where a face is located.
# (NormalizedRect)
input_stream: "ROI:roi"
# Whether to run face mesh model with attention on lips and eyes. (bool)
# Attention provides more accuracy on lips and eye regions as well as iris
# landmarks.
input_side_packet: "WITH_ATTENTION:with_attention"

# 468 or 478 facial landmarks within the given ROI. (NormalizedLandmarkList)
#
# Number of landmarks depends on the WITH_ATTENTION flag. If it's `true` - then
# there will be 478 landmarks with refined lips, eyes and irises (10 extra
# landmarks are for irises), otherwise 468 non-refined landmarks are returned.
#
# NOTE: if a face is not present within the given ROI, for this particular
# timestamp there will not be an output packet in the LANDMARKS stream. However,
# the MediaPipe framework will internally inform the downstream calculators of
# the absence of this packet so that they don't wait for it unnecessarily.
output_stream: "LANDMARKS:face_landmarks"

# MediaPipe graph configuration
node {
  calculator: "GpuBufferToImageFrameCalculator"
  input_stream: "IMAGE:image"
  output_stream: "image_frame"
}

node {
  calculator: "ColorConvertCalculator"
  input_stream: "image_frame"
  output_stream: "image_rgb"
}

node {
  calculator: "ImageFrameToGpuBufferCalculator"
  input_stream: "image_rgb"
  output_stream: "image_gpu"
}

# Transforms the input image into a 192x192 tensor.
node: {
  calculator: "ImageToTensorCalculator"
  input_stream: "image_gpu"
  input_stream: "NORM_RECT:roi"
  output_stream: "TENSORS:input_tensors"
  options: {
    [mediapipe.ImageToTensorCalculatorOptions.ext] {
      output_tensor_width: 192
      output_tensor_height: 192
      output_tensor_float_range {
        min: 0.0
        max: 1.0
      }
      gpu_origin: TOP_LEFT
    }
  }
}


    face_mash = mp_face_mesh.FaceMesh()
  File "/usr/local/lib/python3.10/dist-packages/mediapipe/python/solutions/face_mesh.py", line 95, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/mediapipe/python/solution_base.py", line 235, in __init__
    validated_graph.initialize(
RuntimeError: ValidatedGraphConfig Initialization failed.
ColorConvertCalculator::GetContract failed to validate:
For input streams ValidatePacketTypeSet failed:
Tag "" index 0 was not expected.
For output streams ValidatePacketTypeSet failed:
Tag "" index 0 was not expected.
ImageToTensorCalculator: ; RET_CHECK failure (mediapipe/calculators/tensor/image_to_tensor_calculator.cc:145) kIn(cc).IsConnected() ^ kInGpu(cc).IsConnected()One and only one of IMAGE and IMAGE_GPU input is expected.

Other info / Complete Logs

No response

SlowMonk avatar Apr 29 '24 08:04 SlowMonk

Hi @SlowMonk,

It seems that the issue may be related to changes in versions 0.10.10 and later, Already known to us. To troubleshoot, could you try downgrading to version 0.10.9 and see if that resolves the issue? Please let us know if everything functions as expected after the downgrade.

Thank you!!

kuaashish avatar Apr 30 '24 08: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 08 '24 01:05 github-actions[bot]

I have a similar issue, downgrading did not resolve the issue. Same error

Howl1n avatar May 10 '24 11:05 Howl1n

Hi @SlowMonk,

Please try the latest version, 0.10.14, based on the suggestions given here: comment, It must work. If you encounter any problems, just let us know by filing a new issue using the template provided.

Thank you!!

kuaashish avatar May 13 '24 04:05 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 21 '24 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 28 '24 01:05 github-actions[bot]

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

google-ml-butler[bot] avatar May 28 '24 01:05 google-ml-butler[bot]