Apple M1 和其他设备上的 TensorFlow 的通用要求.txt
我有一本新的MacBook和Apple M1芯片组。要安装TensorFlow,我按照说明在这里,即,安装tensorflow-tensorflow-金属
和tensorflow-macos
而不是普通tensorflow
package。
虽然工作正常,但这意味着我无法运行典型的pip install -ruesignt.txt
,只要我们在supports.txt中具有
。相反,如果我们包括tensorflow
tensorflow-macos
,它将导致非M1甚至非麦克索用户的问题。
我们的图书馆必须在所有平台上工作。是否有通用安装命令可以根据计算机是否是M1 Mac来安装正确的TensorFlow版本?这样我们就可以为每个人使用单个unigess.txt
?
或者,如果不可能,我们可以传递某些标志/选项,例如pip install -r unignts.txt -m1
安装一些变化吗? 这里最简单,最优雅的解决方案是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据这篇文章有没有办法有条件要求。txt文件我的python应用程序基于平台?
您可以在您的需求上使用条件。
According to this post Is there a way to have a conditional requirements.txt file for my Python application based on platform?
You can use conditionals on your requirements.txt, thus