tensorflow / text

Making text a first-class citizen in TensorFlow.
https://www.tensorflow.org/beta/tutorials/tensorflow_text/intro
Apache License 2.0
1.21k stars 333 forks source link

Building nightly from source fails with patch error #1252

Closed 19lmyers closed 4 months ago

19lmyers commented 4 months ago

Hello, I'm having an error trying to build this project from source with tf-nightly and tf-nightly-macos installed. Specifically, when I try and run the build, I get the following error:

ERROR: Error computing the main repository mapping: no such package '@org_tensorflow//tensorflow': Error applying patch <details omitted>/text/third_party/tensorflow/tf.patch: Incorrect Chunk: the chunk content doesn't match the target
**Original Position**: 37

**Original Content**:
load("//third_party/nccl:nccl_configure.bzl", "nccl_configure")
load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo")
load("//third_party/pasta:workspace.bzl", pasta = "repo")
load("//third_party/py:python_configure.bzl", "python_configure")
load("//third_party/py/ml_dtypes:workspace.bzl", ml_dtypes = "repo")
load("//third_party/pybind11_abseil:workspace.bzl", pybind11_abseil = "repo")
load("//third_party/pybind11_bazel:workspace.bzl", pybind11_bazel = "repo")

**Revised Content**:
load("//third_party/nccl:nccl_configure.bzl", "nccl_configure")
load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo")
load("//third_party/pasta:workspace.bzl", pasta = "repo")
load("//third_party/py/non_hermetic:python_configure.bzl", "python_configure")
load("//third_party/py/ml_dtypes:workspace.bzl", ml_dtypes = "repo")
load("//third_party/pybind11_abseil:workspace.bzl", pybind11_abseil = "repo")
load("//third_party/pybind11_bazel:workspace.bzl", pybind11_bazel = "repo")

Ideally I'd like to get this package working with Keras 3, but I'm not sure if that's possible, which is why I'm using the nightly.

19lmyers commented 4 months ago

Turns out I was doing a few things incorrectly. I fixed my problem by using TensorFlow 2.16.0rc0, installing tf-nightly-metal instead of tf-nightly-macos, and running a different build command (adapted from the Docker instructions).