エラー内容
mediapipeをインストールし、hello Worldを実行することはできたのですが、handtrackingのデモをビルドしようとするとエラーが発生してしまいます。
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu qwerty@ubuntu:~/mediapipe$ bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "c2cdcf55ffaf49366725639e45dedd449b8c3fe22b54e31625eb80ce3a240f1e" DEBUG: Repository rules_foreign_cc instantiated at: /home/qwerty/mediapipe/WORKSPACE:42:13: in <toplevel> Repository rule http_archive defined at: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel> WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found WARNING: Download from http://mirror.tensorflow.org/github.com/tensorflow/runtime/archive/44c890cd46fd9aad2b3bf4b13c5f36d8cff795c3.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'com_google_absl' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'com_google_protobuf' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'com_google_googletest' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'build_bazel_apple_support' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'bazel_skylib' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/org_tensorflow/third_party/repo.bzl:108:14: Warning: skipping import of repository 'pybind11' because it already exists. DEBUG: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/tf_runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software. INFO: Build option --compilation_mode has changed, discarding analysis cache. DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "02413e4a077107711ecc21458432e7c9ba63e75e63f3fa84ae4da2d6b2c82700" DEBUG: Repository rules_cc instantiated at: /home/qwerty/mediapipe/WORKSPACE:36:13: in <toplevel> Repository rule http_archive defined at: /home/qwerty/.cache/bazel/_bazel_qwerty/a12d07e16a57f8d88ea378494a9d1b0e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel> WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/ruy/archive/d37128311b445e758136b8602d1bbd2a755e115d.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found INFO: Analyzed target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu (65 packages loaded, 6134 targets configured). INFO: Found 1 target... INFO: From ProtoCompile mediapipe/calculators/util/rect_to_render_data_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/core/gate_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/calculator_profile.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/internal/callback_packet_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/tool/calculator_graph_template.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/tensor/tensors_to_landmarks_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/util/landmarks_to_render_data_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/calculator.pb.h [for host]: bazel-out/host/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/video/opencv_video_encoder_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/util/collection_has_min_size_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/util/labels_to_render_data_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/util/annotation_overlay_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/core/split_vector_calculator.pb.h: bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/calculator_profile.pb.h [for host]: bazel-out/host/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/calculators/core/gate_calculator.pb.h [for host]: bazel-out/host/bin/external/com_google_protobuf/src: warning: directory does not exist. ERROR: /home/qwerty/mediapipe/mediapipe/examples/desktop/BUILD:38:11: C++ compilation of rule '//mediapipe/examples/desktop:demo_run_graph_main' failed (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 61 argument(s) skipped) Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 61 argument(s) skipped) Use --sandbox_debug to see verbose messages from the sandbox In file included from ./mediapipe/framework/formats/image_frame_opencv.h:20, from mediapipe/examples/desktop/demo_run_graph_main.cc:22: ./mediapipe/framework/port/opencv_core_inc.h:18:10: fatal error: opencv2/core/version.hpp: No such file or directory 18 | #include <opencv2/core/version.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Target //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 53.610s, Critical Path: 46.95s INFO: 419 processes: 247 internal, 172 linux-sandbox. FAILED: Build did NOT complete successfully
###現在の環境
Ubuntuのバージョンは20.04です。
Python3のバージョンは3.8.10です。
openCVとFFmpegのインストールは次のコマンドでインストールしました。
sudo apt-get install libopencv-core-dev libopencv-highgui-dev \ libopencv-calib3d-dev libopencv-features2d-dev \ libopencv-imgproc-dev libopencv-video-dev
(https://google.github.io/mediapipe/getting_started/install.html#installing-on-debian-and-ubuntu の手順3のオプション1)
bazeliskはhttps://www.flywheel.jp/topics/bazel_version_1_1_0/#install
を参考にインストールしました。
よろしくお願いします!
あなたの回答
tips
プレビュー