Win10编译tensorflow1.13.1报错:“ no such package '@grpc//': java.io.IOException:”

本文解决在使用Bazel构建TensorFlow时遇到的grpc模块下载失败问题,提供了一个具体的解决方案,即通过浏览器下载tar.gz包,并将其上传到HTTP服务器,修改workspace.bzl文件中的urls路径,成功完成构建。
部署运行你感兴趣的模型镜像

问题描述

bazel build时报错:

INFO: Invocation ID: d724bb63-c981-4352-93c3-537440fa1b13
ERROR: D:/tensorflow-1.13.1/source/tensorflow/BUILD:385:1: no such package '@grpc//': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/grpc/grpc/archive/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz, https://github.com/grpc/grpc/archive/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz] to C:/users/administrator/_bazel_administrator/y46qiod6/external/grpc/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz: Tried to reconnect at offset 275,764 but server didn't support it and referenced by '//tensorflow:grpc'
ERROR: Analysis of target '//tensorflow:libtensorflow_cc.so' failed; build aborted: Analysis failed
INFO: Elapsed time: 80.424s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (99 packages loaded, 6752 targets configured) Fetching @grpc; fetching 72s
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files: d:\tensorflow-1.13.1\source/.bazelrc
INFO: Invocation ID: 1e244094-f546-46a2-8a08-01f5bd1c890b

原因是grpc模块的69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz包下载失败。

解决方案

通过chrome浏览器下载69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz包,然后将tar.gz包上传到http文件服务器,通过http文件服务器加载tar.gz包。具体操作可参考怎么在本地架设一个简单的HTTP服务器?

在tensorflow/tensorflow/workspace.bzl中urls中加入tar.gz包在http文件服务中的路径:
在这里插入图片描述
重新build, 完美解决!

您可能感兴趣的与本文相关的镜像

TensorFlow-v2.15

TensorFlow-v2.15

TensorFlow

TensorFlow 是由Google Brain 团队开发的开源机器学习框架,广泛应用于深度学习研究和生产环境。 它提供了一个灵活的平台,用于构建和训练各种机器学习模型

评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值