Closed anpaulin closed 2 years ago
Although I want to share you how to build in as much detail as possible, there are still various problems. There are three main aspects:
wheel
.bazel
. You can carefully check your bazel
. If you have installed it with brew
on a mac, it is likely that the uninstallation is not clean. Please check whether the soft link is correct to the specified version.I would love to use your precompiled wheel, however unfortunately I'm working with a project that only supports Java 8 at the moment and going to be using the JAVA api for tensorfow. As such, your precompiled wheel is for tensorflow-text version 2.8.1, which requires tensorflow version 2.8. Unfortunately, the only version of the tensorflow java project that is compatible with 2.8+ is 0.5.0 which only supports Java 11+...
As you can see I'm in a bit of a predicament here...
If you could supply a wheel for 2.7 of tensorflow-text I would be forever grateful. In the meantime, I'll loop back around and get provide more details regarding my initial question & error message
Looping back around I checked out branch 2.7 which looks to have your commit which adds M1 support as its latest commit.
running ./oss_scripts/run_build.sh I get the following error:
ERROR: /private/var/tmp/_bazel_USER/f34013cb46e7b7980816551b07367b89/external/bazel_tools/src/tools/launcher/BUILD:9:14: While resolving toolchains for target @bazel_tools//src/tools/launcher:launcher: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
ERROR: Analysis of target '//oss_scripts/pip_package:build_pip_package' failed; build aborted:
MacOS == 12.3.1 Machine == 2020 MacbookPro tensorflow-macos == 2.7.0 bazel == 5.1.1
This tutorial currently only works with tensorflow-text 2.8.x
, so it is possible that your build will fail. Based on the information you provided, your bazel
version is too high, tensorflow-text 2.7
must use bazel 3.7.2
, any other version will fail. So you need to downgrade your bazel
.
That's strange... when I ran the /oss_scripts/run_build.sh with bazel 4.2.2 on the latest commit of 2.7 I get the following error:
ERROR: The project you're trying to build requires Bazel 5.1.1
That's because the source code of tensorflow
is downloaded when building tensorflow-text
, and the master branch currently uses bazel 5.1.1
.
In this case you may need to modify the build script to switch the downloaded tensorflow
branch to 2.7
.
I do believe the tensorflow version is set correctly
Starting local Bazel server and connecting to it...
Loading: 0 packages loaded
Fetching @org_tensorflow; fetching 27s
Fetching https://github.com/tensorflow/tensorflow/archive/v2.7.0.zip; 39,428,608B 26s
I encourage you to checkout 2.7
of tensorflow-text and try running the build script.
I'm sorry that my previous build of tensorflow-text 2.7
can't be found, since the precompiled package for M1 is only available from bazel 4.0.0
. Recompiling basel 3.7.2
will break a lot of current things (you should also know that there is no docker image for macOS).
I found a wheel from a previous PR, hope it helps you.
Sadly it seems that wheel isn't the one I need...
Do you have tensorflow_text-2.7.0-cp39-cp39-macosx_11_0_arm64.whl ?
First off, I applaud you for maintaining these instructions for people struggling with getting things running on an M1 machine...
Following you instructions for building tensorflow_text, I run into the following issue:
I tried various suggestions on modifying the WORKPLACE file, but haven't been able to get around it....