I have a new MacBook with the Apple M1 chipset. To install tensorflow, I follow the instructions here, i.e., installing tensorflow-metal
and tensorflow-macos
instead of the normal tensorflow
package.
While this works fine, it means that I can't run the typical pip install -r requirements.txt
as long as we have tensorflow
in the requirements.txt
. If we instead include tensorflow-macos
, it'll lead to problems for non-M1 or even non-macOS users.
Our library must work on all platforms. Is there a generic install command that installs the correct TensorFlow version depending on whether the computer is a M1 Mac or not? So that we can use a single requirements.txt
for everyone?
Or if that's not possible, can we pass some flag/option, e.g., pip install -r requirements.txt --m1
to install some variation?
What's the simplest and most elegant solution here?