mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Anyone successfully build python wheel on desktop?

Open smithlai opened this issue 1 year ago • 0 comments

OS Platform and Distribution

mediapipe Docker on Ubuntu22.04

Compiler version

gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

Programming Language and version

python

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

venv

MediaPipe version

58cd91d5083e7cc1b4e19f4cc705943ecd8f0ef5

Bazel version

6.1.1

XCode and Tulsi versions (if iOS)

No response

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

Here are the try-error steps:

git clone --depth 1 https://github.com/google/mediapipe.git
cd mediapipe
docker build --tag=mediapipe .
docker run -v `pwd`:/mediapipe2 -it --name mediapipe mediapipe:latest

cd mediapipe2

GLOG_logtostderr=1 bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world

.....
..........

apt install sudo
sudo apt install -y python3-dev python3-venv protobuf-compiler cmake vim

python3 -m venv mp_env && source mp_env/bin/activate
pip3 install -r requirements.txt
python3 setup.py bdist_wheel

error: invalid command 'bdist_wheel'

pip install wheel
python3 setup.py bdist_wheel

......
.....

This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.

setup.py:230

      protoc_command = [
          self._protoc, '-I.',
+         '--experimental_allow_proto3_optional',
          '--python_out=' + os.path.abspath(self.build_lib), source
      ]
python3 setup.py bdist_wheel
........
......

Foreign Cc - CMake: Building opencv_cmake failed: (Exit 1)

chmod u+x setup_opencv.sh
./setup_opencv.sh

E: Unable to locate package libdc1394-22-dev

setup_opencv.sh:43

-     sudo apt install cmake ffmpeg libavformat-dev libdc1394-22-dev libgtk2.0-dev \
+     sudo apt install cmake ffmpeg libavformat-dev libdc1394-dev libgtk2.0-dev \
./setup_opencv.sh
.........
............
> Done

python3 setup.py bdist_wheel

/usr/bin/ld.gold: error: cannot find -lavresample

https://github.com/google-ai-edge/mediapipe/issues/5059

third_party/BUILD:271

-         -lavresample
+        #-lavresample
python3 setup.py bdist_wheel

gcc: error: unrecognized command-line option '-mavxvnniint8'; did you mean '-mavxvnni'?

gcc: error: unrecognized command-line option '-mavx512fp16'; did you mean '-mavx512bf16'?

However, I cannot do anything further...

Complete Logs


Here are the last messages:


WARNING: /mediapipe2/mediapipe/framework/tool/BUILD:204: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/python:_framework_bindings.so (91 packages loaded, 3643 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/09343b6c38ae1b3a8117934d2d2a1cb0/external/XNNPACK/BUILD.bazel:784:36: Compiling external/XNNPACK/avxvnniint8_prod_microkernels.c failed: (Exit 1): gcc failed: error executing command (from target @XNNPACK//:avxvnniint8_prod_microkernels) /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 102 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mavxvnniint8'; did you mean '-mavxvnni'?
ERROR: /root/.cache/bazel/_bazel_root/09343b6c38ae1b3a8117934d2d2a1cb0/external/XNNPACK/BUILD.bazel:784:36: Compiling external/XNNPACK/avx512fp16_prod_microkernels.c failed: (Exit 1): gcc failed: error executing command (from target @XNNPACK//:avx512fp16_prod_microkernels) /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 108 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
gcc: error: unrecognized command-line option '-mavx512fp16'; did you mean '-mavx512bf16'?
Target //mediapipe/python:_framework_bindings.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.090s, Critical Path: 0.07s
INFO: 3 processes: 3 internal.
FAILED: Build did NOT complete successfully
Command '['bazel', 'build', '--compilation_mode=opt', '--copt=-DNDEBUG', '--keep_going', '--action_env=PYTHON_BIN_PATH=/mediapipe2/mp_env/bin/python3', '//mediapipe/python:_framework_bindings.so', '--define=MEDIAPIPE_DISABLE_GPU=1', '--define=OPENCV=source']' returned non-zero exit status 1.

====================================================================================

smithlai avatar Oct 18 '24 07:10 smithlai