mediapipe
mediapipe copied to clipboard
mediapipe can not build in ubuntu20.04
- OS Platform and Distribution (e.g. Linux Ubuntu 16.04, Android 11, iOS 14.4):linux Ubuntu20.04 in rockpi
- MediaPipe version:0.8.9
- Bazel version:5.2.0
- OpenCV version (if running on desktop):4.2.0
when i do bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 mediapipe/modules/holistic_landmark:holistic_landmark_gpu output the ERROR: WARNING: /home/rock/mediapipe-master/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/rock/mediapipe-master/mediapipe/framework/tool/BUILD:184: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/modules/holistic_landmark:holistic_landmark_gpu (0 packages loaded, 0 targets configured). INFO: Found 1 target... ERROR: /home/rock/mediapipe-master/mediapipe/framework/BUILD:526:11: Compiling mediapipe/framework/counter_factory.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 38 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging gcc: error: mediapipe/framework/counter_factory.cc: Permission denied gcc: fatal error: no input files compilation terminated. Target //mediapipe/modules/holistic_landmark:holistic_landmark_gpu failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 1.644s, Critical Path: 0.80s INFO: 87 processes: 87 internal. FAILED: Build did NOT complete successfully
how can i do mydear
Hi @ChenZedie, Could you please try to run the same command in a command line with administrative privileges. Thank you!
Hi@kuaashish ,Thank you very much for your reply.I'm a Linux newbie.I executed the "sudo bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 mediapipe/modules/holistic_landmark:holistic_landmark_gpu" command under root and got the same error as above.
and i executed "sudo bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 mediapipe/modules/holistic_landmark:holistic_landmark_gpu --sandbox_debug" output error like this:
WARNING: /home/rock/mediapipe-master/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/rock/mediapipe-master/mediapipe/framework/tool/BUILD:184: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/modules/holistic_landmark:holistic_landmark_gpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/rock/mediapipe-master/mediapipe/framework/BUILD:526:11: Compiling mediapipe/framework/counter_factory.cc failed: (Exit 1): linux-sandbox failed: error executing command
(cd /root/.cache/bazel/_bazel_root/a72936712a1017aeb09dced44d06b75b/sandbox/linux-sandbox/5062/execroot/mediapipe &&
exec env -
PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-5.2.0-linux-arm64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
PWD=/proc/self/cwd
TMPDIR=/tmp
/root/.cache/bazel/bazel_root/install/0f213247804519331681f5a8469944bb/linux-sandbox -t 15 -w /root/.cache/bazel/bazel_root/a72936712a1017aeb09dced44d06b75b/sandbox/linux-sandbox/5062/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/aarch64-opt/bin/mediapipe/framework/objs/counter_factory/counter_factory.pic.d '-frandom-seed=bazel-out/aarch64-opt/bin/mediapipe/framework/objs/counter_factory/counter_factory.pic.o' -fPIC -iquote . -iquote bazel-out/aarch64-opt/bin -iquote external/com_github_glog_glog -iquote bazel-out/aarch64-opt/bin/external/com_github_glog_glog -iquote external/com_github_gflags_gflags -iquote bazel-out/aarch64-opt/bin/external/com_github_gflags_gflags -iquote external/com_google_absl -iquote bazel-out/aarch64-opt/bin/external/com_google_absl -Ibazel-out/aarch64-opt/bin/external/com_github_glog_glog/virtual_includes/default_glog_headers -Ibazel-out/aarch64-opt/bin/external/com_github_gflags_gflags/virtual_includes/gflags -w -DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11 '-std=c++17' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP="redacted"' '-D__TIME="redacted"' -c mediapipe/framework/counter_factory.cc -o bazel-out/aarch64-opt/bin/mediapipe/framework/_objs/counter_factory/counter_factory.pic.o)
1658913675.053140517: src/main/tools/linux-sandbox.cc:152: calling pipe(2)...
1658913675.053402148: src/main/tools/linux-sandbox.cc:171: calling clone(2)...
1658913675.064726382: src/main/tools/linux-sandbox.cc:180: linux-sandbox-pid1 has PID 33677
1658913675.072076977: src/main/tools/linux-sandbox-pid1.cc:641: Pid1Main started
1658913675.072821037: src/main/tools/linux-sandbox-pid1.cc:260: working dir: /root/.cache/bazel/_bazel_root/a72936712a1017aeb09dced44d06b75b/sandbox/linux-sandbox/5062/execroot/mediapipe
1658913675.072896288: src/main/tools/linux-sandbox-pid1.cc:292: writable: /root/.cache/bazel/_bazel_root/a72936712a1017aeb09dced44d06b75b/sandbox/linux-sandbox/5062/execroot/mediapipe
1658913675.072916706: src/main/tools/linux-sandbox-pid1.cc:292: writable: /tmp
1658913675.072933914: src/main/tools/linux-sandbox-pid1.cc:292: writable: /dev/shm
1658913675.073082376: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /
1658913675.073105418: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev
1658913675.073122044: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev/pts
1658913675.073138378: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /dev/shm
1658913675.073153545: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev/hugepages
1658913675.073169003: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /dev/mqueue
1658913675.073184462: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run
1658913675.073199337: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/lock
1658913675.073214796: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/user/1000
1658913675.073231713: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /run/user/1000/gvfs
1658913675.073244839: src/main/tools/linux-sandbox-pid1.cc:382: remount(nullptr, /run/user/1000/gvfs, nullptr, 2101287, nullptr) failure (Permission denied) ignored
1658913675.073266131: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys
1658913675.073280714: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/security
1658913675.073302882: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup
1658913675.073321840: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/unified
1658913675.073399426: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/systemd
1658913675.073419843: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/devices
1658913675.073437343: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/blkio
1658913675.073454844: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/perf_event
1658913675.073471761: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/cpu,cpuacct
1658913675.073489261: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/hugetlb
1658913675.073506470: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/freezer
1658913675.073523970: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/memory
1658913675.073540887: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/cpuset
1658913675.073557804: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/pids
1658913675.073575305: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/cgroup/net_cls,net_prio
1658913675.073592805: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/pstore
1658913675.073609722: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/debug
1658913675.073670974: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/tracing
1658913675.073690808: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/fs/fuse/connections
1658913675.073711517: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /sys/kernel/config
1658913675.073728725: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /proc
1658913675.073743892: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /proc/sys/fs/binfmt_misc
1658913675.073771893: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /boot
1658913675.073816227: src/main/tools/linux-sandbox-pid1.cc:362: remount ro: /boot
1658913675.073832853: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /root/.cache/bazel/_bazel_root/a72936712a1017aeb09dced44d06b75b/sandbox/linux-sandbox/5062/execroot/mediapipe
1658913675.073852395: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /root/.cache/bazel/_bazel_root/a72936712a1017aeb09dced44d06b75b/sandbox/linux-sandbox/5062/execroot/mediapipe
1658913675.073866979: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /tmp
1658913675.073881562: src/main/tools/linux-sandbox-pid1.cc:362: remount rw: /dev/shm
1658913675.073959148: src/main/tools/linux-sandbox-pid1.cc:451: calling fork...
1658913675.074438659: src/main/tools/linux-sandbox-pid1.cc:481: child started with PID 2
1658913675.074694457: src/main/tools/linux-sandbox.cc:197: done manipulating pipes
gcc: error: mediapipe/framework/counter_factory.cc: Permission denied
gcc: fatal error: no input files
compilation terminated.
1658913675.088441624: src/main/tools/linux-sandbox-pid1.cc:498: wait returned pid=2, status=0x100
1658913675.088499959: src/main/tools/linux-sandbox-pid1.cc:516: child exited normally with code 1
1658913675.152165923: src/main/tools/linux-sandbox.cc:233: child exited normally with code 1
Target //mediapipe/modules/holistic_landmark:holistic_landmark_gpu failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.267s, Critical Path: 0.60s
INFO: 130 processes: 130 internal.
FAILED: Build did NOT complete successfully
Hi @ChenZedie, Could you please elaborate your query with complete details and steps to reproduce the issue. Thank you!
@kuaashish , Thank you very much for your reply. I've solved this problem by modifying the mediaippe source version. But a new problem arose, I built the version of the GPU with the "xxx" instruction, but the following error occurred.
error:
Traceback (most recent call last):
File "mp_wavehand_finished.py", line 92, in
Can you tell me that the calculator is registered under that path?
My command is ”bazel build -c opt --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 mediapipe/modules/holistic_landmark:holistic_landmark_gpu“.
My test code is as follows:
cap = cv2.VideoCapture(4)
mp_holistic = mp.solutions.holistic holistic = mp_holistic.Holistic(model_complexity=0) error here. for i in range(0,10): if not cap.isOpened(): try: cap.open(i) except: pass else: break
while cap.isOpened():
success, img = cap.read(4)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = cv2.flip(img, 1)
results = holistic.process(img)
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
h, w, c = img.shape
hand_clmList = []
if results.left_hand_landmarks:
for id, lm in enumerate(results.left_hand_landmarks.landmark):
cx, cy = lm.x * w, lm.y * h
hand_clmList.append((cx, cy))
cv2.circle(img, (int(cx), int(cy)), 3, (255, 255, 255), 5)
angle_list = hand_angle(hand_clmList)
gesture_str = hand_gesture(angle_list)
cv2.putText(img, gesture_str, (30, 80), cv2.FONT_HERSHEY_PLAIN, 2, (0, 0, 255), 3)
cv2.imshow("image", img)
if cv2.waitKey(2) & 0xFF == 27:
break
cap.release()
Hi @ChenZedie, Could you please confirm still looking for a resolution for the issue or has it been resolved. You can refer to this closed issue #2126 for "Unable to find calculator" error. Thank you!
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.
Closing as stale. Please reopen if you'd like to work on this further.