tensorflow编辑serving错误解决: no such package '@boringssl_git//': Error cloning repository: https://boringssl.googlesource.com/boringssl:








在部署tensorflow的serving的时候, 按照官方的教程, 到了编译serving的时候:


bazel build tensorflow_serving/...
因为国内网络被墙,无法连接google的googlesource.com的服务器,所以编译提示如下错误:

ERROR: /home/xxx/code/serving/WORKSPACE:18:1: no such package '@boringssl_git//': Error cloning repository: https://boringssl.googlesource.com/boringssl: cannot open git-upload-pack caused by https://boringssl.googlesource.com/boringssl: cannot open git-upload-pack caused by Connection timed out boringssl.googlesource.com and referenced by '//external:libssl'.
ERROR: Analysis of target '//tensorflow_serving/example:mnist_inference_2' failed; build aborted.

在网上搜索,提示修改workspace文件的内容,讲remote修改为"https://github.com/doubler/boringssl-bazel.git", 但是实际上这个github上的库不知道为啥缺少文件,提示依然有错误。

于是自己clone了一份代码到github,终于搞定。

解决方法如下:

修改文件:serving/tensorflow/tensorflow/workspace.bzl

将:

native.new_git_repository(
name = "boringssl_git",
commit = "e72df93461c6d9d2b5698f10e16d3ab82f5adde3",
remote = "https://boringssl.googlesource.com/boringssl",
build_file = path_prefix + "boringssl.BUILD",
)

修改为:
native.new_git_repository(
name = "boringssl_git",
#commit = "e72df93461c6d9d2b5698f10e16d3ab82f5adde3",
#remote = "https://boringssl.googlesource.com/boringssl",
commit = "78ba5bce77f18363273902997ec195b0ab2e8579",
remote = "https://github.com/thewintersun/boringssl.git",
build_file = path_prefix + "boringssl.BUILD",
)

然后重新运行: bazel build tensorflow_serving/...
搞定!!!