WSL可在微软应用商店中下载。
打开Ubuntu会让你创建用户名和密码。
关于这部分流程可以查看这个博主的流程
https://blog.csdn.net/qq_36818449/article/details/103879399
但是在照着博主做的过程中注意,Bazel的版本要是1.1.0的,因为mediapipe现在最多支持1.1.0的Bazel,安装0.27的是不可以运行的。
在流程都运行成功后
// An highlighted block
bazel run --define MEDIAPIPE_DISABLE_GPU=1 \
mediapipe/examples/desktop/hello_world:hello_world
在这一部分我开始疯狂报错。
// An highlighted block
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "C:/users/username/_bazel_username/zbffnwmd/external/org_tensorflow/third_party/py/python_configure.bzl", line 210
_get_python_lib(repository_ctx, <1 more arguments>)
File "C:/users/username/_bazel_username/zbffnwmd/external/org_tensorflow/third_party/py/python_configure.bzl", line 130, in _get_python_lib
execute(repository_ctx, <1 more arguments>)
File "C:/users/username/_bazel_username/zbffnwmd/external/org_tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Repository command failed
File "<string>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
查看是否安装numpy和python3并且,运行以下代码:
// An highlighted block
echo $PYTHON_BIN_PATH
export PYTHON_BIN_PATH=/usr/bin/python3
$PYTHON_BIN_PATH -c 'import numpy'
最后就可以成功运行helloword那部分了:
// An highlighted block
Target //mediapipe/examples/desktop/hello_world:hello_world up-to-date:
bazel-bin/mediapipe/examples/desktop/hello_world/hello_world
INFO: Elapsed time: 0.467s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/mediapipe/examples/desktop/hello_world/INFO: Build completed successfully, 1 total action
I20201104 09:18:22.609808 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.611129 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.611586 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.612054 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.612463 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.612954 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.613397 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.613579 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.614965 3170 hello_world.cc:56] Hello World!
I20201104 09:18:22.616818 3170 hello_world.cc:56] Hello World!
在安装过程中遇到不少问题,这个困扰我好久,如果有什么别的问题或者安装包,也可以联系我。