我在windows中安装了docker工具箱,我还为tensorflow和bazel提取了图像。 当我在码头工程中运行bazel时如下:
docker run -it insready/bazel:latest bash
bazel运行,但在工作场所没有张量流,因为我“git clone tensorflow”,我可以运行:
bazel build tensorflow/python/tools:optimize_for_inference
错误发生protobuf文件无法下载! 如何使用bazel工具优化tensorflow模型(.pb文件)以在android环境中构建应用程序?
root@8f43a8b6c598:/usr/src/app/tensorflow# bazel build tensorflow/python/tools:o
ptimize_for_inference
Extracting Bazel installation...
..............................
ERROR: /usr/src/app/tensorflow/tensorflow/python/tools/BUILD:147:1: error loadin
g package 'tensorflow/core': Encountered error while reading extension file 'pro
tobuf.bzl': no such package '@protobuf//': Traceback (most recent call last):
File "/u_apply_patch(repo_ctx, repo_ctx.attr.patch_file) line 119
File "/u_execute_and_check_ret_code(repo_ctx, cmd).bzl", line 110, in _a
pply_patFile "/usr/src/app/tensorflow/tensorflow/workspace.bzl", line 94, in _ex
ecute_and_check_fail("Non-zero return code({1}) when ..., <2 more arguments>))
Non-zero return code(256) when executing 'patch -p1 -d /root/.cache/bazel/_bazel
_root/fcc55b35a14d93d1b456fb4b036f6add/external/protobuf -i /usr/src/app/tensorf
low/third_party/protobuf/add_noinlines.patch':
Stdout:
Stderr: java.io.IOException: Cannot run program "patch" (in directory "/root/.ca
che/bazel/_bazel_root/fcc55b35a14d93d1b456fb4b036f6add/external/protobuf"): erro
r=2, No such file or directory and referenced by '//tensorflow/python/tools:opti
mize_for_inference'.
ERROR: Analysis of target '//tensorflow/python/tools:optimize_for_inference' fai
led; build aborted.
答案 0 :(得分:1)
根据您的错误消息:
Cannot run program "patch"
可能未安装补丁,请尝试apt-get install patch
?