sun1638650145 / Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon

This Repo will provide TensorFlow libraries and extended build tutorials that require compilation to build, as well as pre-compiled wheel files.
115 stars 9 forks source link

Not able to install tensorflow-text #6

Closed Fred-Wu closed 2 years ago

Fred-Wu commented 2 years ago

I have tensorflow-macos and tensorflow-metal v2.9.2 installed on my Macbook M1 with Python 3.10.5.

Are they the right version of Python and tensorflow installed for tensorflow-text?

The build of Text-2.90 failed with the following erros.

ERROR: /private/var/tmp/_bazel_fredwu/111899d0b2568b38b38ed1b7a930bdf7/external/com_google_sentencepiece/BUILD.bazel:51:11: Compiling src/normalizer.cc failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 70 arguments skipped)
external/com_google_sentencepiece/src/normalizer.cc:25:10: error: module @com_google_sentencepiece//:sentencepiece_processor does not depend on a module exporting 'third_party/darts_clone/darts.h'
#include "third_party/darts_clone/darts.h"

I also tried to use bazel 5.1.1, but it gave the error saying it required 5.3

ERROR: The project you're trying to build requires Bazel 5.3.0 (specified in /Users/xxx/Downloads/text-2.9.0/.bazelversion), but it wasn't found in /opt/homebrew/Cellar/bazel/5.1.1/libexec/bin.

And also the wheel could not be installed either.

ERROR: tensorflow_text-2.9.0-cp38-cp38-macosx_10_16_arm64.whl is not a supported wheel on this platform.

Any advises would be appreciated.

Fred-Wu commented 2 years ago

I have re-read your tutorial, and re-solved the issue. Thank you. I will close this now.

sun1638650145 commented 2 years ago

First, I'm glad you solved the problem. Second, if you think this is a worthwhile problem, I welcome and recommend that you write down your solution so it can help others.

Fred-Wu commented 2 years ago

Thanks. Bascially I just need roll back to Python 3.9.X, and TF's minor version has to match to TF text's minor version, like cannot use 2.9.2 TF with 2.9.0 TF text.

And don't need to build from the source once version matches. I just use the wheel file you provide here, and that works OK.