Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensorflow-text build issues #1

Closed
anpaulin opened this issue Apr 17, 2022 · 11 comments
Closed

tensorflow-text build issues #1

anpaulin opened this issue Apr 17, 2022 · 11 comments
Assignees
Labels
question Further information is requested

Comments

@anpaulin
Copy link

anpaulin commented Apr 17, 2022

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:

ERROR: /private/var/tmp/_bazel_USER/9f8724fe94ef5d3d184dee8c41f63e97/external/com_google_protobuf/BUILD:981:21: in proto_lang_toolchain rule @com_google_protobuf//:cc_toolchain: '@com_google_protobuf//:cc_toolchain' does not have mandatory provider 'ProtoInfo'.

I tried various suggestions on modifying the WORKPLACE file, but haven't been able to get around it....

@sun1638650145 sun1638650145 added the question Further information is requested label Apr 18, 2022
@sun1638650145
Copy link
Owner

sun1638650145 commented Apr 18, 2022

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:

  1. If it's just for use, I provide a pre compiled wheel.
  2. Most of the problems in the build process are caused by 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.
  3. Please provide your system and environment information, I can't find the cause of the error with only one error.

@sun1638650145 sun1638650145 changed the title Tensorflow-text build issues tensorflow-text build issues Apr 18, 2022
@sun1638650145 sun1638650145 self-assigned this Apr 18, 2022
@anpaulin
Copy link
Author

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

@anpaulin
Copy link
Author

anpaulin commented Apr 19, 2022

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

@sun1638650145
Copy link
Owner

sun1638650145 commented Apr 20, 2022

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.

@anpaulin
Copy link
Author

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

@sun1638650145
Copy link
Owner

That's because the source code of tensorflow is downloaded when building tensorflow-text, and the master branch currently uses bazel 5.1.1.

@sun1638650145
Copy link
Owner

sun1638650145 commented Apr 20, 2022

In this case you may need to modify the build script to switch the downloaded tensorflow branch to 2.7.

@anpaulin
Copy link
Author

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.

@sun1638650145
Copy link
Owner

sun1638650145 commented Apr 20, 2022

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).

@sun1638650145
Copy link
Owner

I found a wheel from a previous PR, hope it helps you.

@anpaulin
Copy link
Author

anpaulin commented Apr 20, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants