Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediapipe failed to build on Windows #5252

Closed
bleakcollaroc opened this issue Mar 22, 2024 · 8 comments
Closed

mediapipe failed to build on Windows #5252

bleakcollaroc opened this issue Mar 22, 2024 · 8 comments
Assignees
Labels
os:windows MediaPipe issues on Windows task::all All tasks of MediaPipe type:build/install For Build and Installation issues

Comments

@bleakcollaroc
Copy link

bleakcollaroc commented Mar 22, 2024

OS Platform and Distribution

Windows 10

Compiler version

MSVC 14.29.30133

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

No

MediaPipe version

Latest

Bazel version

6.4.0

XCode and Tulsi versions (if iOS)

No

Android SDK and NDK versions (if android)

No

Android AAR (if android)

None

OpenCV version (if running on desktop)

3.4.10

Describe the problem

bazel stopped at llvm-raw extracting

Complete Logs

I've followed document here to build mediapipe on my Windows PC:
https://developers.google.com/mediapipe/framework/getting_started/install

Upon executing bazel build, below error popped out all the times:

>bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --jobs=auto --local_ram_resources=20000 --verbose_failures --action_env PYTHON_BIN_PATH="C://Python312//python.exe" mediapipe/examples/desktop/hello_world
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading:
    Fetching repository @llvm-raw; starting 176s
    Fetching ...zel_laxus/hr7sucjp/external/llvm-raw; Extracting 8697bbe2d4aed109520e83c6beab52196ec5b702.tar.gz 175s

Server terminated abruptly (error code: 2, error message: 'Stream removed', log file: 'c:\users\laxus\_bazel_laxus\hr7sucjp\server\jvm.out')

Why error code 2 (COMMAND_LINE_ERROR) even happened while extracting tar.gz file?

@bleakcollaroc bleakcollaroc added the type:build/install For Build and Installation issues label Mar 22, 2024
@kuaashish kuaashish assigned kuaashish and unassigned ayushgdev Mar 26, 2024
@kuaashish kuaashish added os:windows MediaPipe issues on Windows task::all All tasks of MediaPipe labels Mar 26, 2024
@liujiabin20810
Copy link

Above problem is about network connection. maybe need to use vpn.
I complie on the same platform:

Windows11

Compiler version
BAZEL_SH=D:\msys64\usr\bin\bash.exe
BAZEL_VC=D:\Program Files\Microsoft Visual Studio\2022\Community\VC
BAZEL_VC_FULL_VERSION=14.29.30133
BAZEL_WINSDK_FULL_VERSION=10.0.22000.0

bazel version
bazel 6.4.0

THE Result:
external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(361): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(361): error C2143: 语法错误: 缺少“,”(在“*”的 前面) external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(368): error C2065: “depth”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(368): error C2065: “rank”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(369): error C2065: “output_shape”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(369): error C2065: “depth”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(370): error C2065: “output”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(370): error C2065: “init”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “Op”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “input”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “window_shape”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “window_reduce_strides”: 未声明的标识符

I have build the hello-word successfully.
INFO: From Linking mediapipe/examples/desktop/hello_world/hello_world.exe: 正在创建库 bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\hello_world\hello_world.lib 和对象 bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\hello_world\hello_world.exp Target //mediapipe/examples/desktop/hello_world:hello_world up-to-date: bazel-bin/mediapipe/examples/desktop/hello_world/hello_world.exe INFO: Elapsed time: 321.398s, Critical Path: 49.54s INFO: 539 processes: 3 internal, 536 local. INFO: Build completed successfully, 539 total actions

@kyn817046
Copy link

Above problem is about network connection. maybe need to use vpn. I complie on the same platform:

Windows11

Compiler version BAZEL_SH=D:\msys64\usr\bin\bash.exe BAZEL_VC=D:\Program Files\Microsoft Visual Studio\2022\Community\VC BAZEL_VC_FULL_VERSION=14.29.30133 BAZEL_WINSDK_FULL_VERSION=10.0.22000.0

bazel version bazel 6.4.0

THE Result: external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(361): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(361): error C2143: 语法错误: 缺少“,”(在“*”的 前面) external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(368): error C2065: “depth”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(368): error C2065: “rank”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(369): error C2065: “output_shape”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(369): error C2065: “depth”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(370): error C2065: “output”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(370): error C2065: “init”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “Op”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “input”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “window_shape”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “window_reduce_strides”: 未声明的标识符

I have build the hello-word successfully. INFO: From Linking mediapipe/examples/desktop/hello_world/hello_world.exe: 正在创建库 bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\hello_world\hello_world.lib 和对象 bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\hello_world\hello_world.exp Target //mediapipe/examples/desktop/hello_world:hello_world up-to-date: bazel-bin/mediapipe/examples/desktop/hello_world/hello_world.exe INFO: Elapsed time: 321.398s, Critical Path: 49.54s INFO: 539 processes: 3 internal, 536 local. INFO: Build completed successfully, 539 total actions

I'm also having the same issue, can you please fix it?

@Tobe-Young
Copy link

Above problem is about network connection. maybe need to use vpn. I complie on the same platform:

Windows11

Compiler version BAZEL_SH=D:\msys64\usr\bin\bash.exe BAZEL_VC=D:\Program Files\Microsoft Visual Studio\2022\Community\VC BAZEL_VC_FULL_VERSION=14.29.30133 BAZEL_WINSDK_FULL_VERSION=10.0.22000.0

bazel version bazel 6.4.0

THE Result: external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(361): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(361): error C2143: 语法错误: 缺少“,”(在“*”的 前面) external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(368): error C2065: “depth”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(368): error C2065: “rank”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(369): error C2065: “output_shape”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(369): error C2065: “depth”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(370): error C2065: “output”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(370): error C2065: “init”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “Op”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “input”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “window_shape”: 未声明的标识符 external/org_tensorflow/tensorflow/lite/kernels/stablehlo_reduce_window.cc(371): error C2065: “window_reduce_strides”: 未声明的标识符

I have build the hello-word successfully. INFO: From Linking mediapipe/examples/desktop/hello_world/hello_world.exe: 正在创建库 bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\hello_world\hello_world.lib 和对象 bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\hello_world\hello_world.exp Target //mediapipe/examples/desktop/hello_world:hello_world up-to-date: bazel-bin/mediapipe/examples/desktop/hello_world/hello_world.exe INFO: Elapsed time: 321.398s, Critical Path: 49.54s INFO: 539 processes: 3 internal, 536 local. INFO: Build completed successfully, 539 total actions

The solution is simple, Just delete comments in the file stablehlo_reduce_window at line 361, i guess it's a Encoding issues 。
The comment like below:
// Recursively computes strided reductions using a sliding window over the
// given tensor.
//
// The window is defined using a shape and a dilation. The shape defines the
// elements that the window will let the reduction see. The dilation defines
// the step between window elements.
//
// For instance: the following window has a [2, 2] shape and [2, 3] dilations.
//
// 3
// ┌────┐
// ┌─┐ ┌─┐
// │X│X X│X│┐
// └─┘ └─┘│2
// X X X X ┘
// ┌─┐ ┌─┐
// │X│X X│X│
// └─┘ └─┘

@kuaashish
Copy link
Collaborator

Hi @bleakcollaroc,

Could you please confirm whether the issue has been resolved on your end, or if you still require assistance from our end?

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label May 9, 2024
Copy link

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label May 17, 2024
@kyn817046
Copy link

已解决,感谢

@github-actions github-actions bot removed stale stat:awaiting response Waiting for user response labels May 18, 2024
@kuaashish
Copy link
Collaborator

Hi @kyn817046,

Thank you for the confirmation. We are closing this issue as resolved.

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:windows MediaPipe issues on Windows task::all All tasks of MediaPipe type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

6 participants