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

Challenge in Mediapipe's Windows build due to EXTERNAL unsolved issue transferring from Tensorflow #4203

Closed
GeorgeS2019 opened this issue Mar 27, 2023 · 17 comments
Assignees
Labels
os:windows MediaPipe issues on Windows platform:c++ Issues specific to C++ framework in mediapipe type:build/install For Build and Installation issues type:feature Enhancement in the New Functionality or Request for a New Solution

Comments

@GeorgeS2019
Copy link

GeorgeS2019 commented Mar 27, 2023

Update 31st March 2023

Since filing this issue, it is great to see many commits have been done to improve the reliability of building in windows

Update 27th March 2023

Confirm, VS2019 solves many unsolved Windows build issues discussed in tensorflow, Bazel and mediapipe. Windows mediapipe building using e.g. MSYS2, MSVC is confusing with untested guidelines AND will continue to lead to frustration when building in Windows.

With VS2019, Windows building will no longer be an experimental waste of time.

@andrechen took THREE weeks
@GeorgeS2019 I wasted ONE week before identifying @andrechen 's workable Windows build VS2019 solution

Previous discusisons ### OS Platform and Distribution

Windows 11

Compiler version

MSVC and GCC (MSYS2)

Programming Language and version

c++

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

No response

MediaPipe version

0.91 and above

Bazel version

5.2

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)

4.x

Describe the problem

March 2023

# Can you provide a compiled project file?

Without this, other projects depending on mediapipe are stalling

Aug 2022

'WindowsApps\python.exe' is not executable

For those still looking for a solution to this problem: it is probably related to the fact that in the installations of Windows that have bash.exe map to WSL, the normal windows paths are not recognized by WSL and so in third_party/py/python_configure.bzl the _check_python_bin fails. You have to translate the paths between Windows and WSL (bash) using the wslpath util.

@rajkundu
Can you share how you make it works in Windows and so the Windows community can stop doing it as Windows support is officially experimental

The main problem of building mediapipe in windows due to unsolved open issues related to external library i.e. tensorflow which has UNSOLVED Python_BIN_PATH inherited from tensorflow

Issues supporting this claim

@andrechen
Could you help us SOLVE this UNSOLVABLE mediapipe problem by updating your contribution?
FYI: https://github.com/andrechen/mediapipe/tree/master/visualstudio

@libaineu2004 => try the Visual Studio build

image

Complete Logs

Installation in windows

@GeorgeS2019 GeorgeS2019 added the type:build/install For Build and Installation issues label Mar 27, 2023
@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Mar 27, 2023

Update March2023

@andrechen

I am using VS2022 and I can compile mediapipe.lib, however I stuck due to tensorflow.lite

Contributions from @andrechen

It took me almost 3 weeks to make face mesh build on Visual Studio before I can test and debug easily. So I'd like to share this to anyone who is surfering bazel build and trying to port to Visual Studio like I did. Would be glad if this saves your precious time. Many thanks to mediapipe team for sharing this fantastic work.

Before open up Visual Studio 2019 and make the build, make camera accessible and install PowerShell if you haven't yet. Also note that all demos should be launched in Visual Studio IDE, for you can easily debug and learn. Have fun!

Now you know everything I know.

History

  • 2022/04/17 init commit.
  • 2022/05/08 add x86(32-bit) target platform, but with few problems... (always prefer x64 versions)
    • [Win32 | Debug] Application crashes after closing. Move to other opencv liibrary may fix this. (cv::VideoCapture)
    • [Win32 | Release] A suspicious Visual Studio 2019 (ver.16.11.13) bug is found when linking tensorflow-static library. Temporary set tensorflow-lite optimization level to Disabled(/Od) to work around this. Set C/C++ | Optimization back to /O2, the error reads like...
      1>------ Build started: Project: face_detection, Configuration: Release Win32 ------
      1> Generating code
      1>D:\git\mediapipe\third_party\tensorflow\third_party\gemmlowp\internal\output.h(176): fatal error C1001: Internal compiler error.
      1>(compiler file 'D:\a\_work\1\s\src\vctools\Compiler\Utc\src\p2\main.c', line 213)
      1> To work around this problem, try simplifying or changing the program near the locations listed above.
      1>If possible please provide a repro here: https://developercommunity.visualstudio.com
      1>Please choose the Technical Support command on the Visual C++
      1> Help menu, or open the Technical Support help file for more information
      1>
      1>Done building project "face_detection.vcxproj" -- FAILED.
      
  • 2022/05/10 Add live_demo, all-in-one demo. Also, mediapipe.lib now become a monolithic static library!!!
  • 2022/05/29 Add face_effect, selfie_segmentation and face_geometry test module in face_mesh
  • 2022/06/08 Tested on Visual Studio 2022 version 17.2.3
  • 2022/07/16 Merge v0.8.10.2
  • 2022/07/17 face_effect example now can export Wavefront .obj files (press 'o' key)
  • 2022/09/12 Merge v0.8.11
  • 2022/10/08 Merged from upstream

@ayushgdev ayushgdev added type:feature Enhancement in the New Functionality or Request for a New Solution os:windows MediaPipe issues on Windows platform:c++ Issues specific to C++ framework in mediapipe labels Mar 27, 2023
@ayushgdev
Copy link
Contributor

Hello @GeorgeS2019 Thanks for collecting issues and compiling a elaborated issue description. It helps us understand the problem better.
@jiuqiant Would you please check this issue ?

@ayushgdev ayushgdev assigned jiuqiant and unassigned ayushgdev Mar 27, 2023
@ayushgdev ayushgdev added the stat:awaiting googler Waiting for Google Engineer's Response label Mar 27, 2023
@GeorgeS2019
Copy link
Author

@andrechen

2022/06/08 Tested on Visual Studio 2022 version 17.2.3

I have tried using the latest VS2022, 17.5.0 => the build fail

@GeorgeS2019
Copy link
Author

This branch: mediapipe_library seems to be complete with the latest tflite files

FYI: discussion

@GeorgeS2019
Copy link
Author

Consider supporting this issue

@google-ml-butler
Copy link

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

@andrechen
Copy link

@andrechen

2022/06/08 Tested on Visual Studio 2022 version 17.2.3

I have tried using the latest VS2022, 17.5.0 => the build fail

You're right, it seems we are having INTERNAL COMPILER ERRORS right now for these versions. Looks like a visual studio bug. But at least, version 17.2.3 does work.

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1001?view=msvc-170

@GeorgeS2019
Copy link
Author

@andrechen

Very appreciate your IMPORTANT contribution to MediaPipe Windows community

@GeorgeS2019
Copy link
Author

@andrechen
I really need to use BlendShape, hopefully in future, u find time to include a blendshape example. Thank you

@kuaashish kuaashish removed the stat:awaiting googler Waiting for Google Engineer's Response label Mar 28, 2023
@GeorgeS2019 GeorgeS2019 reopened this Mar 31, 2023
@GeorgeS2019
Copy link
Author

Since filing this issue, it is great to see many commits have been done to improve the reliability of building in windows

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Apr 1, 2023

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Apr 8, 2023

@rolandeke
@Mr-Khans
#4259
#4246

Both Windows 11, alone or using WSL2, have unsolved (unseparated Windows 11 and WSL) problems

Just a guess. For Google developer not familiar with WSL and Windows 11, there are no clear separation of conditions for compiling that clearly treating WSL and Windows separately. WSL is treated as Linux, without acknowledging there are other non-ubuntu which are challenging when building mediepipe in WSL. Windows 11 suffer cross mixing with WSL (Ubuntu).

Loss to Google

=> Documentation remains non-up-to-date across different Google projects: e.g. tensorflow and mediapipe. This problems are NOT Obvious to upper management and the financial and branding and marketing negative impacts that are on-going here in this issue.

Action

Documentation needs to make that clear as well: both WSL (Ubuntu) and Windows 11 are not reflecting Unsolved issues transferred from TensorFlow

By not tagging probably, MORE and MORE Windows 11 and WSl will keep facing FRUSTRATION without knowing that their problems ARE PART OF BIGGER Neglected Issues across DIFFERENT Google projects for Windows and WSL

@andrechen
Copy link

andrechen commented Apr 20, 2023

@andrechen

2022/06/08 Tested on Visual Studio 2022 version 17.2.3

I have tried using the latest VS2022, 17.5.0 => the build fail

If you're still interested in LEGACY solution, i had fixed tensorflow-lite build break by adding a CPP _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING for visual studio 2022 v17.5.4. It also works for VS2019 16.11.26. both are the latest versions.

One thing that, if you're suffering from C1001: Internal compiler error, try disable CPU overclocking.

image

@kuaashish
Copy link
Collaborator

@GeorgeS2019,

We have this is in our roadmap, We will publish the pre complied binaries for Windows soon. For now, We can commit any timeline to be available. Thank you

@kuaashish kuaashish assigned lu-wang-g and unassigned jiuqiant Jun 20, 2023
@kuaashish kuaashish added the stat:awaiting googler Waiting for Google Engineer's Response label Jun 20, 2023
@lu-wang-g
Copy link
Contributor

What is the issue or feature request here?

@GeorgeS2019
Copy link
Author

Move to #5366

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 platform:c++ Issues specific to C++ framework in mediapipe type:build/install For Build and Installation issues type:feature Enhancement in the New Functionality or Request for a New Solution
Projects
None yet
Development

No branches or pull requests

7 participants