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-addons doesn't work with tensorflow-macos #2503

Closed
atn832 opened this issue Jun 15, 2021 · 14 comments · Fixed by #2504 or #2559
Closed

tensorflow-addons doesn't work with tensorflow-macos #2503

atn832 opened this issue Jun 15, 2021 · 14 comments · Fixed by #2504 or #2559

Comments

@atn832
Copy link

atn832 commented Jun 15, 2021

Describe the feature and the current behavior/state.
On my Mac with M1, on which TensorFlow 2.5 for Mac is installed, pip install tensorflow-addons fails with this error:

% pip install tensorflow-addons
ERROR: Could not find a version that satisfies the requirement tensorflow-addons (from versions: none)
ERROR: No matching distribution found for tensorflow-addons

Here's the output of pip list:

% pip list
Package                 Version
----------------------- -------------------
...
tensorboard-plugin-wit  1.8.0
tensorflow-estimator    2.5.0
tensorflow-macos        2.5.0 <--
tensorflow-metal        0.1.1
termcolor               1.1.0
...

Relevant information

  • Are you willing to contribute it (yes/no): maybe
    If you wish to contribute, then read the requirements for new contributions in CONTRIBUTING.md
  • Are you willing to maintain it going forward? (yes/no):
  • Is there a relevant academic paper? (if so, where): no
  • Does the relavent academic paper exceed 50 citations? (yes/no): n/a
  • Is there already an implementation in another framework? (if so, where):
  • Was it part of tf.contrib? (if so, where): setup.py

Who will benefit with this feature?
Users of TensorFlow for Mac.

Any other info.

@seanpmorgan
Copy link
Member

seanpmorgan commented Jun 15, 2021

Can you use this compilation?
https://github.com/apple/tensorflow_macos

Otherwise you may need to build from source in order to use custom ops. Python ops should work fine (since custom ops are lazily loaded) but you may need to download the whl yourself in order to install

@Liu-Da
Copy link

Liu-Da commented Jun 15, 2021

same issue

@tetsuyasu
Copy link
Contributor

The attached patch enables source build on M1 Mac.
I hope that this fix will be reflected in the original source code.

addons.patch.txt

@tetsuyasu tetsuyasu mentioned this issue Jun 16, 2021
21 tasks
@tetsuyasu
Copy link
Contributor

Please review the pull request.

#2504

@bhack
Copy link
Contributor

bhack commented Jun 17, 2021

@Liu-Da Can you test that PR on your M1?

@tetsuyasu
Copy link
Contributor

tetsuyasu commented Jun 17, 2021

Yes, I did. The steps are as follows.

create python virtual environment

(I installed python 3.9.5 with pyenv and pyenv-virtualenv.)

install tensorflow

pip install tensorflow-macos
pip install tensorflow-metal

install bazel 3.7.2

xcode-select --install || echo OK
export BAZEL_VERSION=3.7.2
curl -fLO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh"
chmod +x "bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh"
./bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh --user
(set the PATH to bazel)

install tensorflow-addons

git clone -b mywork https://github.com/tetsuyasu/addons.git/
cd addons
python3 ./configure.py
bazel build build_pip_pkg
pip install pathlib
bazel-bin/build_pip_pkg artifacts
pip install artifacts/tensorflow_addons-*.whl

@tetsuyasu
Copy link
Contributor

This is a sample build for Python3.9.

tensorflow_addons-0.14.0.dev0-cp39-cp39-macosx_11_0_arm64.zip

@asapsmc
Copy link

asapsmc commented Aug 25, 2021

(sorry if this is not the space for this question) How can I use this solution to install tensorFlow-addons into a Conda environment under macOS M1?

@tetsuyasu
Copy link
Contributor

Instructions to install TensorFlow in a Conda Environment #153
apple/tensorflow_macos#153

@bhack
Copy link
Contributor

bhack commented Aug 26, 2021

It would be nice if you can add something in the Readme.md

@JASC-droid
Copy link

I installed it using pip in console but with my environment activated.

@Zahlii
Copy link

Zahlii commented Mar 30, 2023

Is there any update/current status here? This is still an issue in 2023, and a blocking one for my current development on my new M1/M2 MacBook.

@dudulasry
Copy link

Also an issue for me. I receive an error when trying to install tensorflow-addons on Docker ubuntu image (running in M1):

Unable to find installation candidates for tensorflow-addons (0.17.1)

@MorganFujimaka
Copy link

Same here.

Unable to find installation candidates for tensorflow-addons (0.21.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants