A tutorial how to install Trax in Macbook M1


I searched many resources in the internet, and the finding is the reason why Trax cannot run in Macbook Air M1 is the dependent package Tensor-text is not compatible with Apple’s M1 processor.

Some say they could solve it after tremendous effort. Can anyone share exactly how to fix it step by step? I am really not an expert to fix the infrastructure issue.

Please help! thanks very much

it’s not tensorflow-text that is the real problem.

Even if you get that installed, you still can’t install trax because there isn’t a macos version. You’ll have to run ubuntu.

See also my post in the Apple Developer Forum

https://developer.apple.com/forums/thread/700906

*** copied in case you don’t have Apple account ***
Here’s my experience as of 18 March 2022. Able to install arm64 tensorflow and tensorflow-text and successfully execute the Tensorflow Word Embeddings tutorial found here==> Word embeddings  |  Text  |  TensorFlow. (I downloaded the notebook and ran locally in jupyter)

Create a new virtual environment for this purpose: conda create --name tf_text python=3.8 conda activate tf_text conda install -c apple tensorflow-deps -y pip install tensorflow-macos pip install tensorflow-metal conda install -c conda-forge jupyter jupyterlab -y

Download tensorflow_text-2.8.1-cp38-cp38-macosx_11_0_arm64.whl from here==>Releases · sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon · GitHub

pip install /Downloads/tensorflow_text-2.8.1-cp38-cp38-macosx_11_0_arm64.whl

Able to execute the tutorial locally and produce comparable results. HTH


@charmrain I added some text you might find helpful.

I notice in that linked page @ Apple that the version has revved to 2.12

and some people reported having issues installing that one. I haven’t updated my library, following the ‘ain’t broke’ rule. For now I can still run some NLP stuff using straight TensorFlow, but I never got anywhere with trax itself, and as you saw on another thread here, there is skepticism about its continued existence.