Mediapipe: Latest version does not build on Windows

Created on 14 Jul 2020  路  13Comments  路  Source: google/mediapipe

When I run below command
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Python//Python37//python.exe" mediapipe/examples/desktop/hello_world

it generates the error:

ERROR: D:/git/mediapipe/mediapipe/framework/BUILD:824:1: C++ compilation of rule '//mediapipe/framework:packet' failed (Exit 2)
.\mediapipe/framework/packet.h(448): error C2672: 'absl::lts_2020_02_25::make_unique': no matching overloaded function found
.\mediapipe/framework/packet.h(448): error C2783: 'void std::make_unique(_Types &&...)': could not deduce template argument for '__formal'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\memory(2078): note: see declaration of 'std::make_unique'
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 71.407s, Critical Path: 68.40s
INFO: 152 processes: 152 local.
FAILED: Build did NOT complete successfully

I am using C++ BuildTools version 14.26.28801

If I rollback to mediapipe May version, it builds successfully.

All 13 comments

Also, at step 9 of windows installation guideline, I believe double slash should be used for the PYTHON_BIN_PATH. Otherwise, it will reproduce the issue 724.

i.e.
Note: For building MediaPipe on Windows, please add --action_env PYTHON_BIN_PATH="C://path//to//python.exe" to the build command
C:\Users\Username\mediapipe_repo>bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://python_36//python.exe" mediapipe/examples/desktop/hello_world

i have the exact same issue

My C++ BuildTools version is 14.26.28808 and I have the same issue

The issue occurs at https://github.com/google/mediapipe/blob/e9fbe868e55fa23aaabc31f9f847c22287062850/mediapipe/framework/packet.h#L448

GCC and clang are ok with the syntax [] { return absl::make_unique<Holder<T>>(new T); }) on Linux and macos. However, MSVC is not. It's unclear to me what't the right fix for MSVC on Windows. Any suggestions are welcome.

Please note that MediaPipe Windows support is experimental since we have limited resources and mainly focus on Linux and mobile platforms.

When I run below command
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Python//Python37//python.exe" mediapipe/examples/desktop/hello_world

it generates the error:

ERROR: D:/git/mediapipe/mediapipe/framework/BUILD:824:1: C++ compilation of rule '//mediapipe/framework:packet' failed (Exit 2)
.\mediapipe/framework/packet.h(448): error C2672: 'absl::lts_2020_02_25::make_unique': no matching overloaded function found
.\mediapipe/framework/packet.h(448): error C2783: 'void std::make_unique(_Types &&...)': could not deduce template argument for '__formal'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\memory(2078): note: see declaration of 'std::make_unique'
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 71.407s, Critical Path: 68.40s
INFO: 152 processes: 152 local.
FAILED: Build did NOT complete successfully

I am using C++ BuildTools version 14.26.28801

If I rollback to May version, it builds successfully.

How do you rollback to May version? Do you have a link?

I rolledback to BUildTools version 14.25.28610 and I still see the issue:

ERROR: C:/mediapipe_repo/mediapipe/mediapipe/framework/BUILD:824:11: C++ compilation of rule '//mediapipe/framework:packet' failed (Exit 2)
.\mediapipe/framework/packet.h(448): error C2672: 'absl::lts_2020_02_25::make_unique': no matching overloaded function found
.\mediapipe/framework/packet.h(448): error C2783: 'void std::make_unique(_Types &&...)': could not deduce template argument for '__formal'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC14.25.28610\include\memory(2074): note: see declaration of 'std::make_unique'
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build

When I run below command
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Python//Python37//python.exe" mediapipe/examples/desktop/hello_world
it generates the error:

ERROR: D:/git/mediapipe/mediapipe/framework/BUILD:824:1: C++ compilation of rule '//mediapipe/framework:packet' failed (Exit 2)
.\mediapipe/framework/packet.h(448): error C2672: 'absl::lts_2020_02_25::make_unique': no matching overloaded function found
.\mediapipe/framework/packet.h(448): error C2783: 'void std::make_unique(_Types &&...)': could not deduce template argument for '__formal'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\memory(2078): note: see declaration of 'std::make_unique'
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 71.407s, Critical Path: 68.40s
INFO: 152 processes: 152 local.
FAILED: Build did NOT complete successfully

I am using C++ BuildTools version 14.26.28801
If I rollback to May version, it builds successfully.

How do you rollback to May version? Do you have a link?

https://github.com/google/mediapipe/releases/tag/v0.7.5
You can download the older version as zip here

When I run below command
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Python//Python37//python.exe" mediapipe/examples/desktop/hello_world
it generates the error:

ERROR: D:/git/mediapipe/mediapipe/framework/BUILD:824:1: C++ compilation of rule '//mediapipe/framework:packet' failed (Exit 2)
.\mediapipe/framework/packet.h(448): error C2672: 'absl::lts_2020_02_25::make_unique': no matching overloaded function found
.\mediapipe/framework/packet.h(448): error C2783: 'void std::make_unique(_Types &&...)': could not deduce template argument for '__formal'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\memory(2078): note: see declaration of 'std::make_unique'
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 71.407s, Critical Path: 68.40s
INFO: 152 processes: 152 local.
FAILED: Build did NOT complete successfully

I am using C++ BuildTools version 14.26.28801
If I rollback to May version, it builds successfully.

How do you rollback to May version? Do you have a link?

https://github.com/google/mediapipe/releases/tag/v0.7.5
You can download the older version as zip here

Or just do mediapipe> git checkout v0.7.5.

When I run below command
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Python//Python37//python.exe" mediapipe/examples/desktop/hello_world
it generates the error:

ERROR: D:/git/mediapipe/mediapipe/framework/BUILD:824:1: C++ compilation of rule '//mediapipe/framework:packet' failed (Exit 2)
.\mediapipe/framework/packet.h(448): error C2672: 'absl::lts_2020_02_25::make_unique': no matching overloaded function found
.\mediapipe/framework/packet.h(448): error C2783: 'void std::make_unique(_Types &&...)': could not deduce template argument for '__formal'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include\memory(2078): note: see declaration of 'std::make_unique'
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 71.407s, Critical Path: 68.40s
INFO: 152 processes: 152 local.
FAILED: Build did NOT complete successfully

I am using C++ BuildTools version 14.26.28801
If I rollback to May version, it builds successfully.

How do you rollback to May version? Do you have a link?

https://github.com/google/mediapipe/releases/tag/v0.7.5
You can download the older version as zip here

Or just do mediapipe> git checkout v0.7.5.

Same issue. Rolling back to v0.7.5 works

I have exactly the same issue. I wonder know if there is a new way to fix it now instead rollback the version

It seems like:
https://stackoverflow.com/questions/49117293/templated-variables-bug-with-lambdas-in-visual-studio

This without lambda compiles:

template <typename T>
std::unique_ptr<Holder<T>> GetPointer() {
    return absl::make_unique<Holder<T>>(new T);
}
template <typename T>
NoDestructor<mediapipe::RegistrationToken>
    MessageRegistrationImpl<T>::registration(MessageHolderRegistry::Register(
        T{}.GetTypeName(), GetPointer<T>));
Was this page helpful?
0 / 5 - 0 ratings