google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
26.81k stars 5.09k forks source link

Linking mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph [for tool] failed: #4528

Open scofielddd opened 1 year ago

scofielddd commented 1 year ago

OS Platform and Distribution

Mac os Ventura 13.0.01

Compiler version

Xcode 14.2

Programming Language and version

swift

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

No response

MediaPipe version

No response

Bazel version

6.1.1

XCode and Tulsi versions (if iOS)

Xcode 14.2

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

No response

Describe the problem

when I compile the code, it would give me this error: "Linking mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/modules/hand_landmark:hand_landmark_model_loader_graph_text_to_binary_graph)" which relate to the code that mediapipe_simple_subgraph(
    name = "hand_landmark_model_loader",
    graph = "hand_landmark_model_loader.pbtxt",
    register_as = "HandLandmarkModelLoader",
    deps = [
        "//mediapipe/calculators/core:constant_side_packet_calculator",
        "//mediapipe/calculators/tflite:tflite_model_calculator",
        "//mediapipe/calculators/util:local_file_contents_calculator",
        "//mediapipe/framework/tool:switch_container",
    ],
)

Complete Logs

I use the opencv install for the option 2: port install opencv. For the workspace, I change the code to these:new_local_repository(
    name = "macos_opencv",
    build_file = "@//third_party:opencv_macos.BUILD",
    path = "/opt",
)

new_local_repository(
    name = "macos_ffmpeg",
    build_file = "@//third_party:ffmpeg_macos.BUILD",
    path = "/opt",
)
and for the opencv_macos.BUILD, I change the code to cc_library(
    name = "opencv",
    srcs = glob(
        [
            "local/lib/libopencv_core.dylib",
            "local/lib/libopencv_highgui.dylib",
            "local/lib/libopencv_imgcodecs.dylib",
            "local/lib/libopencv_imgproc.dylib",
            "local/lib/libopencv_video.dylib",
            "local/lib/libopencv_videoio.dylib",
        ],
    ),
    hdrs = glob(["local/include/opencv2/**/*.h*"]),
    includes = ["local/include/"],
    linkstatic = 1,
    visibility = ["//visibility:public"],
)
for the ffmpeg_macos.BUILD, I change the code to this:
cc_library(
    name = "libffmpeg",
    srcs = glob(
        [
            "local/lib/libav*.dylib",
        ],
    ),
    hdrs = glob(["local/include/libav*/*.h"]),
    includes = ["local/include/"],
    linkopts = [
        "-lavcodec",
        "-lavformat",
        "-lavutil",
    ],
    linkstatic = 1,
    visibility = ["//visibility:public"],
).
scofielddd commented 1 year ago

Here is the specific error message I have now

截屏2023-06-08 16 18 39 截屏2023-06-08 16 18 53
scofielddd commented 1 year ago

the first picture is about the error message, the second picture is related to the code

scofielddd commented 1 year ago

is there anybody can help me?????? wuwuwwuwuwuwuwuwwu

scofielddd commented 1 year ago

is there anyone who can help me? I feel alone -----------"tmd jiu jiu wo ba"

scofielddd commented 1 year ago

is there anybody can help me?

scofielddd commented 1 year ago

when I compile on cmd by using bazel: it would give me these error:ERROR: /Users/scofield/Desktop/labproject/mediapipe/mediapipe/modules/hand_landmark/BUILD:35:26: Linking mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/modules/hand_landmark:hand_landmark_model_loader_graph_text_to_binary_graph) external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/mediapipe/modules/hand_landmark/hand_landmark_model_loader_graph_text_to_binary_graph-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging stderr (/private/var/tmp/_bazel_scofield/eaac3fc385bdf0a2cbf65b0db75374c3/execroot/mediapipe/bazel-out/_tmp/actions/stderr-47) 1523788 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping Target //mediapipe/examples/ios/handtrackinggpu:HandTrackingGpuApp failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 9.077s, Critical Path: 8.37s INFO: 63 processes: 48 internal, 14 darwin-sandbox, 1 local. FAILED: Build did NOT complete successfully

scofielddd commented 1 year ago

is there anybody help me?

kuaashish commented 1 year ago

Hello @jiuqiant,

Could you please look into this issue. Thank you

ndrnrc commented 1 year ago

same problem

KrystalNa commented 1 year ago

I have the same problem

emmasteimann commented 1 year ago

Same.

chensisi0730 commented 1 year ago

Same.

chensisi0730 commented 1 year ago

apple M1 . ?

aperez-hub commented 12 months ago

Any solution on this?

Same issue with this environment: Intel MacOS Ventura 13.3.1 Xcode 14.3.1 Bazel 6.1.1