Closed catqaq closed 1 year ago
Hi @catqaq ! Error shows incomplete transaction between client and server . Can you check these the steps for installation of Bazel in this gist and Tested configuration (GCC 7.3.1) with Bazel 4.2.1 or 5.0.0 after resetting your internet connection? Thanks!
@mohantym Hi, i followed the steps for installation of Bazel in this gist. But I got the same error as above: root@9e54466822ea:/# bazel 2022/05/06 11:27:22 Downloading https://releases.bazel.build/5.1.1/release/bazel-5.1.1-linux-x86_64... 2022/05/06 11:27:22 could not download Bazel: HTTP GET https://releases.bazel.build/5.1.1/release/bazel-5.1.1-linux-x86_64 failed: Get "https://releases.bazel.build/5.1.1/release/bazel-5.1.1-linux-x86_64": read tcp 172.17.0.14:55828->130.211.22.235:443: read: connection reset by peer
@mohantym Hi, I re-installed bazel several times, and things are starting to change. root@9e54466822ea:/tensorflow_src# bazel /usr/local/bin/bazel: line 163: /usr/local/lib/bazel/bin/bazel-real: cannot execute binary file: Exec format error ERROR: The project you're trying to build requires Bazel 5.1.1 (specified in /tensorflow_src/.bazelversion), but it wasn't found in /usr/local/lib/bazel/bin.
Bazel binaries for all official releases can be downloaded from here: https://github.com/bazelbuild/bazel/releases
You can download the required version directly using this command: (cd "/usr/local/lib/bazel/bin" && curl -fLO https://releases.bazel.build/5.1.1/release/bazel-5.1.1-linux-x86_64 && chmod +x bazel-5.1.1-linux-x86_64)
After (cd "/usr/local/lib/bazel/bin" && curl -fLO https://releases.bazel.build/5.1.1/release/bazel-5.1.1-linux-x86_64 && chmod +x bazel-5.1.1-linux-x86_64),bazel installation seems success with some errors: root@9e54466822ea:/usr/local/lib/bazel/bin# chmod +x bazel-5.1.1-linux-x86_64 root@9e54466822ea:/usr/local/lib/bazel/bin# bazel /usr/local/bin/bazel: line 220: /usr/local/lib/bazel/bin/bazel-real: cannot execute binary file: Exec format error /usr/local/bin/bazel: line 220: /usr/local/lib/bazel/bin/bazel-real: Success
Then, I run ./configure and build tflite aar again, but failed with jdk11 related error even though I installed jdk11 by sudo apt install openjdk-11-jdk:
bash tensorflow/lite/tools/build_aar.sh --input_models=model.tflite --target_archs=arm64-v8a,armeabi-v7a
WARNING: Download from https://mirror.bazel.build/openjdk/azul-zulu11.50.19-ca-jdk11.0.12/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz failed: class javax.net.ssl.SSLException Connection reset
ERROR: An error occurred during the fetch of repository 'remotejdk11_linux':
Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/43801f1e35f242fb634ebbc6079cf6c5/external/bazel_tools/tools/build_defs/repo/http.bzl", line 100, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://mirror.bazel.build/openjdk/azul-zulu11.50.19-ca-jdk11.0.12/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz] to /root/.cache/bazel/_bazel_root/43801f1e35f242fb634ebbc6079cf6c5/external/remotejdk11_linux/temp14285363683548491890/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz: Connection reset
ERROR: /DEFAULT.WORKSPACE.SUFFIX:41:6: fetching http_archive rule //external:remotejdk11_linux: Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/43801f1e35f242fb634ebbc6079cf6c5/external/bazel_tools/tools/build_defs/repo/http.bzl", line 100, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://mirror.bazel.build/openjdk/azul-zulu11.50.19-ca-jdk11.0.12/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz] to /root/.cache/bazel/_bazel_root/43801f1e35f242fb634ebbc6079cf6c5/external/remotejdk11_linux/temp14285363683548491890/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz: Connection reset
INFO: Repository remote_java_tools instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:392:6: in
Ok @catqaq ! Thanks for reporting the bug. @sachinprasadhs ! Could you please look at this issue?
@mohantym @sachinprasadhs Hi, one more thing, why does tensorflow master branch in the container built by default docker file tflite-android.Dockerfile use bazel5.1.1 and gcc9.4.0? When switched to r2.8, required bazel version is 4.2.1. Looking forward to your help!
tensorflow-2.8.0 | 3.7-3.10 | GCC 7.3.1 | Bazel 4.2.1 -- | -- | -- | --@karimnosseir @sachinprasadhs @mohantym Hi, I give up to use docker and tried to build tflite aar in windows. Unfortunately, the network problem persists. Any idea to use local file instead of downloading to avoid network error? I tried to use local file, but it seems something wrong. ` http_archive( name = "io_bazel_rules_closure", sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9", strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149", urls = [ "file:../tensorflow/third_party:308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13 ], ) http_archive( name = "rules_pkg", sha256 = "352c090cc3d3f9a6b4e676cf42a6047c16824959b438895a76c2989c6d7c246a", urls = [ "file:../tensorflow/third_party:rules_pkg-0.2.5.tar.gz", "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz", ], ) http_archive( name = "llvm-raw", build_file_content = "# empty", sha256 = LLVM_SHA256, strip_prefix = "llvm-project-" + LLVM_COMMIT, urls = [ "file:///third_party:llvm-project-55c71c9eac9bc7f956a05fa9258fad4f86565450.tar.gz", ], ) tf_http_archive( name = "tf_runtime", sha256 = TFRT_SHA256, strip_prefix = "runtime-{commit}".format(commit = TFRT_COMMIT),
urls = ["file:../tensorflow/third_party:runtime-c3e082762b7664bbc7ffd2c39e86464928e27c0c.tar.gz"],
# A patch file can be provided for atomic commits to both TF and TFRT.
# The job that bumps the TFRT_COMMIT also resets patch_file to 'None'.
patch_file = None,
)
`
INFO: Found applicable config definition build:monolithic in file d:\tensorflow\tensorflow-r2.8.bazelrc: --define framework_shared_object=false
ERROR: Traceback (most recent call last):
File "D:/tensorflow/tensorflow-r2.8/WORKSPACE", line 11, column 14, in
I also tried to build bazel from scratch, but it still Build Bazel with Bazel. So, got the network error too.
root@9e54466822ea:/bazel-4.2.1-dist# env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" bash ./compile.sh
🍃 Building Bazel from scratch......
🍃 Building Bazel with Bazel.
DEBUG: /tmp/bazel_W5uGPzng/out/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:14:
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '3.1.0'
DEBUG: /tmp/bazel_W5uGPzng/out/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:14: rbe_ubuntu1804_java11 not using checked in configs as detect_java_home was set to True
DEBUG: /tmp/bazel_W5uGPzng/out/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:14:
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '3.1.0'
DEBUG: /tmp/bazel_W5uGPzng/out/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:14: rbe_ubuntu1604_java8 not using checked in configs as detect_java_home was set to True
INFO: Repository remotejdk11_linux instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:52:6: in
ERROR: Could not build Bazel
@karimnosseir @sachinprasadhs @mohantym Hi, Can we download all dependencies at once and load them locally? Currently I can only handle network errors for each package one by one, download the package first, and change the url to a local path, which is too time consuming.
Hi, Did you follow this document to setup build without docker.
Hi, of course I did, but failed for network error.
Hi, Did you follow this document to setup build without docker.
Hi @catqaq
I was checking if the issue still persists. Can you try with latest r2.12 version which requires Bazel 5.3.0 as per build configuration.
I have tested on arm64 with Bazel 5.3.0 and able build the tensorflow-lite.aar
file without any error. Please find the screenshot below.
Thanks.
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.
Click to expand!
### Issue Type Build/Install ### Source source ### Tensorflow Version tensorflow from your tensorflow/tensorflow:devel ### Custom Code No ### OS Platform and Distribution Ubuntu 20.04.4 LTS ### Mobile device android ### Python version 3.8 ### Bazel version no ### GCC/Compiler version gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) ### CUDA/cuDNN version no ### GPU model and memory no cuda ### Current Behaviour? ```shell Hi, i followed your tutorial