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.95k stars 5.1k forks source link

compile mediapipe for edgetpu dev board : "ERROR: Skipping 'build': no such target '//:build': target 'build' not declared in package '' defined " #3734

Closed fjzhangcr closed 1 year ago

fjzhangcr commented 2 years ago

Please make sure that this is a build/installation issue and also refer to the troubleshooting documentation before raising any issues.

System information (Please provide as much relevant information as possible)

Describe the problem: bazel is a necessary tool especially the 5.2.0 version for the mediapipe source code on my ubuntu. So i check the version of bazel on my ubuntu ,it is 5.2.0 indeed@indeed-virtual-machine:~/Desktop/mediapipe-master$ bazel version Build label: 5.2.0 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Tue Jun 7 16:02:26 2022 (1654617746) Build timestamp: 1654617746 Build timestamp as int: 1654617746

I think I have acomplished the software dependency~~ But when I build the mediapipe edgetpu demo, it tell me that Skipping 'build': no such target '//:build': indeed@indeed-virtual-machine:~/Desktop/mediapipe-master$ bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=usb --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu build

indeed@indeed-virtual-machine:~/Desktop/mediapipe-master$ bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=usb --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu build DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_absl' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_benchmark' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'pybind11_bazel' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_protobuf' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_google_googletest' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'build_bazel_apple_support' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'xctestrunner' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/8841f98192e74cc58dc35ba42db474f7/external/org_tensorflow/third_party/repo.bzl:124:14: Warning: skipping import of repository 'pybind11' because it already exists. ERROR: Skipping 'build': no such target '//:build': target 'build' not declared in package '' defined by /home/indeed/Desktop/mediapipe-master/BUILD.bazel ERROR: no such target '//:build': target 'build' not declared in package '' defined by /home/indeed/Desktop/mediapipe-master/BUILD.bazel INFO: Elapsed time: 0.341s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded)

Provide the exact sequence of commands / steps that you executed before running into the problem:

Complete Logs: Include Complete Log information or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached:

sureshdagooglecom commented 1 year ago

Hi @fjzhangcr , I would request you to check the above with the latest release and let us know if you still see the same.

fjzhangcr commented 1 year ago

hi,thank you for you response~~~ i git clone the latest released mediapipe repo, and try bazel build again, the error message changed WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/131dda9acc6978aba4740d75ca45f411fbabd726.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/8700849191dea2ca9c12a3d26ec41fac0814671b.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found

the two tar.gz file did not fetchable~~~,the download behavior is caused automatically by the bazel build command image

the full logs run as follow: indeed@indeed-virtual-machine:~/Desktop/mediapipe$ bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=all --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu build 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/indeed/Desktop/mediapipe/WORKSPACE:49:13: in <toplevel> Repository rule http_archive defined at: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in <toplevel> WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/131dda9acc6978aba4740d75ca45f411fbabd726.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/8700849191dea2ca9c12a3d26ec41fac0814671b.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_google_absl' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_google_benchmark' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'flatbuffers' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'pybind11_bazel' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_googlesource_code_re2' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_google_protobuf' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_google_googletest' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'zlib' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'build_bazel_apple_support' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'xctestrunner' because it already exists. DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/5b644fe33591354a539bfc79061a6dd0/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'pybind11' because it already exists. ERROR: Skipping 'build': no such target '//:build': target 'build' not declared in package '' defined by /home/indeed/Desktop/mediapipe/BUILD.bazel ERROR: no such target '//:build': target 'build' not declared in package '' defined by /home/indeed/Desktop/mediapipe/BUILD.bazel INFO: Elapsed time: 0.556s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) indeed@indeed-virtual-machine:~/Desktop/mediapipe$

LightBreakfast commented 1 year ago

I am seeing this exact issue too.

Loading: 0 packages loaded Loading: 0 packages loaded 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 Loading: 0 packages loaded WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/8700849191dea2ca9c12a3d26ec41fac0814671b.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded 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 FoundLoading: 0 packages loaded WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/131dda9acc6978aba4740d75ca45f411fbabd726.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found DEBUG: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_google_absl' because it already exists. DEBUG: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/org_tensorflow/third_party/repo.bzl:132:14: Warning: skipping import of repository 'com_google_benchmark' because it already exists. DEBUG: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/org_tensorflow/third_party/repo.bzl:132:14:

Previous comments indicate that it is blocked in China. However, I am not in China (in Australia), so I'm not sure why I could not access this.

kuaashish commented 1 year ago

Hello @fjzhangcr, bazel build command expects a target which is being inferred as build since the command ends with it. However, the command should point to the target specified in the BUILD file. In the bazel command you are running, there is an extra build word at the end. Would you please try removing the word and running the command again? Thank you!

fjzhangcr commented 1 year ago

thanks for your reply~~ after delete the last word of the command, it can build further~~ BUT, the build process still stuck at opencv problem.

bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=usb --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu --sandbox_debug --verbose_failures the key infomation from the log is

./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>

the full log is here

(base) indeed@indeed-virtual-machine:~/Desktop/mediapipe_all/20221128/mediapipe$ bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=usb --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu --sandbox_debug  --verbose_failures
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'flatbuffers' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_googlesource_code_re2' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'zlib' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
WARNING: /home/indeed/Desktop/mediapipe_all/20221128/mediapipe/mediapipe/framework/BUILD:54:24: in cc_library rule //mediapipe/framework:calculator_cc_proto: target '//mediapipe/framework:calculator_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
WARNING: /home/indeed/Desktop/mediapipe_all/20221128/mediapipe/mediapipe/framework/tool/BUILD:185:24: in cc_library rule //mediapipe/framework/tool:field_data_cc_proto: target '//mediapipe/framework/tool:field_data_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
INFO: Analyzed target //mediapipe/examples/coral:face_detection_tpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/indeed/Desktop/mediapipe_all/20221128/mediapipe/mediapipe/calculators/image/BUILD:230:11: Compiling mediapipe/calculators/image/image_transformation_calculator.cc failed: (Exit 1): linux-sandbox failed: error executing command 
  (cd /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/sandbox/linux-sandbox/1086/execroot/mediapipe && \
  exec env - \
    PATH=/home/indeed/anaconda3/bin:/home/indeed/anaconda3/condabin:/home/indeed/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /home/indeed/.cache/bazel/_bazel_indeed/install/41b71f1bb3ce13f20cfeeb31a9357113/linux-sandbox -t 15 -w /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/sandbox/linux-sandbox/1086/execroot/mediapipe -w /tmp -w /dev/shm -D -- /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 -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-opt/bin/mediapipe/calculators/image/_objs/image_transformation_calculator/image_transformation_calculator.d '-frandom-seed=bazel-out/k8-opt/bin/mediapipe/calculators/image/_objs/image_transformation_calculator/image_transformation_calculator.o' '-DMEDIAPIPE_DISABLE_GPU=1' -DMEDIAPIPE_PROFILER_AVAILABLE -iquote . -iquote bazel-out/k8-opt/bin -iquote external/com_google_protobuf -iquote bazel-out/k8-opt/bin/external/com_google_protobuf -iquote external/zlib -iquote bazel-out/k8-opt/bin/external/zlib -iquote external/com_google_absl -iquote bazel-out/k8-opt/bin/external/com_google_absl -iquote external/com_github_glog_glog -iquote bazel-out/k8-opt/bin/external/com_github_glog_glog -iquote external/com_github_gflags_gflags -iquote bazel-out/k8-opt/bin/external/com_github_gflags_gflags -iquote external/linux_opencv -iquote bazel-out/k8-opt/bin/external/linux_opencv -Ibazel-out/k8-opt/bin/external/com_github_glog_glog/_virtual_includes/default_glog_headers -Ibazel-out/k8-opt/bin/external/com_github_gflags_gflags/_virtual_includes/gflags -isystem external/com_google_protobuf/src -isystem bazel-out/k8-opt/bin/external/com_google_protobuf/src -isystem external/zlib -isystem bazel-out/k8-opt/bin/external/zlib -w '-std=c++17' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c mediapipe/calculators/image/image_transformation_calculator.cc -o bazel-out/k8-opt/bin/mediapipe/calculators/image/_objs/image_transformation_calculator/image_transformation_calculator.o)
1669747461.784999515: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1669747461.785039374: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1669747461.785398392: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 86402
1669747461.785444708: src/main/tools/linux-sandbox-pid1.cc:641: Pid1Main started
1669747461.785494230: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
1669747461.785644343: src/main/tools/linux-sandbox-pid1.cc:260: working dir: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/sandbox/linux-sandbox/1086/execroot/mediapipe
1669747461.785666848: src/main/tools/linux-sandbox-pid1.cc:292: writable: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/sandbox/linux-sandbox/1086/execroot/mediapipe
1669747461.785673583: src/main/tools/linux-sandbox-pid1.cc:292: writable: /tmp
1669747461.785679885: src/main/tools/linux-sandbox-pid1.cc:292: writable: /dev/shm
1669747461.785729305: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /
1669747461.785738958: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev
1669747461.785743898: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev/pts
1669747461.785749092: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /dev/shm
1669747461.785752418: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev/hugepages
1669747461.785756728: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev/mqueue
1669747461.785761242: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run
1669747461.785768581: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/lock
1669747461.785773794: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/vmblock-fuse
1669747461.785779640: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/user/1000
1669747461.785802026: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/user/1000/gvfs
1669747461.785813161: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/user/1000/doc
1669747461.785840096: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/snapd/ns
1669747461.785845680: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys
1669747461.785849808: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/security
1669747461.785856026: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup
1669747461.785860778: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/unified
1669747461.785865890: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/systemd
1669747461.785870384: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/misc
1669747461.785874733: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/perf_event
1669747461.785879115: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/cpuset
1669747461.785883764: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/blkio
1669747461.785888122: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/net_cls,net_prio
1669747461.785892359: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/memory
1669747461.785896626: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/freezer
1669747461.785918701: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/cpu,cpuacct
1669747461.785923791: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/devices
1669747461.785928302: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/hugetlb
1669747461.785932757: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/rdma
1669747461.785937040: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/pids
1669747461.785941230: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/pstore
1669747461.785945753: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/bpf
1669747461.785950479: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/debug
1669747461.785955187: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/tracing
1669747461.785966720: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/config
1669747461.785971667: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/fuse/connections
1669747461.785976958: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /proc
1669747461.785981504: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /proc/sys/fs/binfmt_misc
1669747461.785987667: src/main/tools/linux-sandbox-pid1.cc:382: remount(nullptr, /proc/sys/fs/binfmt_misc, nullptr, 2101281, nullptr) failure (Operation not permitted) ignored
1669747461.786011587: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /proc/sys/fs/binfmt_misc
1669747461.786016725: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/core20/1623
1669747461.786020701: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/bare/5
1669747461.786023961: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gtk-common-themes/1534
1669747461.786027513: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gnome-3-28-1804/161
1669747461.786031598: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/core18/2566
1669747461.786034784: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gtk-common-themes/1535
1669747461.786037813: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/netron/285
1669747461.786041508: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gnome-3-34-1804/72
1669747461.786045181: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gnome-3-38-2004/115
1669747461.786048481: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gnome-3-34-1804/77
1669747461.786051434: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/gnome-3-38-2004/119
1669747461.786054530: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/snap-store/558
1669747461.786072518: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/snap-store/599
1669747461.786076486: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/snapd/17029
1669747461.786080246: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /boot/efi
1669747461.786085839: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /mnt/hgfs
1669747461.786091721: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /media/indeed/Ubuntu 20.04.3 LTS amd64
1669747461.786096059: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/snapd/17576
1669747461.786099809: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/core20/1695
1669747461.786102984: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/core18/2632
1669747461.786105979: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /snap/netron/295
1669747461.786113347: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/sandbox/linux-sandbox/1086/execroot/mediapipe
1669747461.786118395: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/sandbox/linux-sandbox/1086/execroot/mediapipe
1669747461.786121928: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /tmp
1669747461.786125210: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /dev/shm
1669747461.786167755: src/main/tools/linux-sandbox-pid1.cc:451: calling fork...
1669747461.786291641: src/main/tools/linux-sandbox-pid1.cc:481: child started with PID 2
In file included from ./mediapipe/framework/formats/image_frame_opencv.h:20,
                 from mediapipe/calculators/image/image_transformation_calculator.cc:19:
./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.
1669747462.113330016: src/main/tools/linux-sandbox-pid1.cc:498: wait returned pid=2, status=0x100
1669747462.113342863: src/main/tools/linux-sandbox-pid1.cc:516: child exited normally with code 1
1669747462.113794561: src/main/tools/linux-sandbox.cc:233: child exited normally with code 1
Target //mediapipe/examples/coral:face_detection_tpu failed to build
INFO: Elapsed time: 0.934s, Critical Path: 0.49s
INFO: 57 processes: 57 internal.
FAILED: Build did NOT complete successfully
(base) indeed@indeed-virtual-machine:~/Desktop/mediapipe_all/20221128/mediapipe$ 

============================================= BTW, the tutorial page give me the command with the last word of [ build ] , it is time to modify the official tutorial now maybe, in case more people like me would face the same problem~~~ the official tutorial is here https://github.com/google/mediapipe/blob/master/mediapipe/examples/coral/README.md and the command which the official tutorial gives out is image

kuaashish commented 1 year ago

@fjzhangcr, Please refer to this specific #2519(comment) for your query.

google-ml-butler[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

fjzhangcr commented 1 year ago

i have try sudo apt-get install libopencv-core-dev the log shows i do not have opencv indeed!~so i press y to install it! (base) indeed@indeed-virtual-machine:~/Desktop/mediapipe_all/20221128/mediapipe$ sudo apt-get install libopencv-core-dev [sudo] password for indeed: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libopencv-core4.2 libtbb-dev libtbb2 Suggested packages: libtbb-doc The following NEW packages will be installed: libopencv-core-dev libopencv-core4.2 libtbb-dev libtbb2 0 upgraded, 4 newly installed, 0 to remove and 123 not upgraded. Need to get 3,113 kB of archives. After this operation, 18.7 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libtbb2 amd64 2020.1-2 [124 kB] Get:2 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libopencv-core4.2 amd64 4.2.0+dfsg-5 [1,027 kB] Get:3 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libtbb-dev amd64 2020.1-2 [273 kB] Get:4 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libopencv-core-dev amd64 4.2.0+dfsg-5 [1,690 kB] Fetched 3,113 kB in 13s (241 kB/s) Selecting previously unselected package libtbb2:amd64. (Reading database ... 223387 files and directories currently installed.) Preparing to unpack .../libtbb2_2020.1-2_amd64.deb ... Unpacking libtbb2:amd64 (2020.1-2) ... Selecting previously unselected package libopencv-core4.2:amd64. Preparing to unpack .../libopencv-core4.2_4.2.0+dfsg-5_amd64.deb ... Unpacking libopencv-core4.2:amd64 (4.2.0+dfsg-5) ... Selecting previously unselected package libtbb-dev:amd64. Preparing to unpack .../libtbb-dev_2020.1-2_amd64.deb ... Unpacking libtbb-dev:amd64 (2020.1-2) ... Selecting previously unselected package libopencv-core-dev:amd64. Preparing to unpack .../libopencv-core-dev_4.2.0+dfsg-5_amd64.deb ... Unpacking libopencv-core-dev:amd64 (4.2.0+dfsg-5) ... Setting up libtbb2:amd64 (2020.1-2) ... Setting up libtbb-dev:amd64 (2020.1-2) ... Setting up libopencv-core4.2:amd64 (4.2.0+dfsg-5) ... Setting up libopencv-core-dev:amd64 (4.2.0+dfsg-5) ... Processing triggers for libc-bin (2.31-0ubuntu9.7) ...

i list the version.hpp, it it in the correct directory: (base) indeed@indeed-virtual-machine:~/Desktop/mediapipe_all/20221128/mediapipe$ ls /usr/include/opencv4/opencv2/core/version.hpp /usr/include/opencv4/opencv2/core/version.hpp

BUT, the bazel build still can not find the version.hpp: bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=usb --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu

`(base) indeed@indeed-virtual-machine:~/Desktop/mediapipe_all/20221128/mediapipe$ bazel build --compilation_mode=opt --define darwinn_portable=1 --define MEDIAPIPE_DISABLE_GPU=1 --define MEDIAPIPE_EDGE_TPU=usb --linkopt=-l:libusb-1.0.so mediapipe/examples/coral:face_detection_tpu 
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'flatbuffers' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_googlesource_code_re2' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'zlib' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: /home/indeed/.cache/bazel/_bazel_indeed/ee9b9c559dd26261239e2921e66c047d/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
WARNING: /home/indeed/Desktop/mediapipe_all/20221128/mediapipe/mediapipe/framework/BUILD:54:24: in cc_library rule //mediapipe/framework:calculator_cc_proto: target '//mediapipe/framework:calculator_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
WARNING: /home/indeed/Desktop/mediapipe_all/20221128/mediapipe/mediapipe/framework/tool/BUILD:185:24: in cc_library rule //mediapipe/framework/tool:field_data_cc_proto: target '//mediapipe/framework/tool:field_data_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
INFO: Analyzed target //mediapipe/examples/coral:face_detection_tpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/indeed/Desktop/mediapipe_all/20221128/mediapipe/mediapipe/calculators/image/BUILD:230:11: Compiling mediapipe/calculators/image/image_transformation_calculator.cc 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 57 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./mediapipe/framework/formats/image_frame_opencv.h:20,
                 from mediapipe/calculators/image/image_transformation_calculator.cc:19:
./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/coral:face_detection_tpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.283s, Critical Path: 0.80s
INFO: 129 processes: 129 internal.
FAILED: Build did NOT complete successfully`
kuaashish commented 1 year ago

Hi @fjzhangcr, It looks like from the logs the particular files which belongs to the opencv2 is missing. Could try out this specific adjustment in ./mediapipe/third_party/opencv_linux.BUILD as done here.

google-ml-butler[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 1 year ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 1 year ago

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