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

Modify to install tensorflow-macos for M1/M2 Mac #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yuzie007
Copy link

Thank you so much developers for sharing the code, which helps me quite a lot for jumping into ML-potential researches!

Short description

This modification allows us to install tensorpotential also in M1/M2 Mac.

Long description

The original tensorflow (as of 2.12.0) seems not available for M1/M2 Mac; we cannot find a wheel for M1/M2 Mac in PyPI (https://pypi.org/project/tensorflow/2.12.0/#files), and indeed I obtained the following error message;

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

Apple, instead, offers their own optimized tensorflow in a different name, tensorflow-macos (see https://developer.apple.com/metal/tensorflow-plugin/). To use this, however, we need to specify tensorflow-macos instead of tensorflow in install_requires.

For a simple specification of a platform, we may be able to use environment markers, but to specify M1/M2 Mac, it seems more straightforward to use the platform library.

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

Successfully merging this pull request may close these issues.

1 participant