【发布时间】:2022-08-04 03:44:25
【问题描述】:
当我尝试在 Apple M1 上安装 TensorFlow 时,我遇到了 4 个问题:
-
Conda has supported M1 since 2022.05.06 但我在 Google 上搜索的大部分文章都在谈论使用 Miniforge,例如所以我觉得它们都有些过时了。
- How To Install TensorFlow on M1 Mac (The Easy Way)
- AI - Apple Silicon Mac M1 natively supports TensorFlow 2.8 GPU acceleration
- How to Setup TensorFlow on Apple M1 Pro and M1 Max (works for M1 too)
- How To Install TensorFlow 2.7 on MacBook Pro M1 Pro With Ease
-
我使用最新的 conda 4.13 成功设置了我的 python 环境(3.8、3.9 和 3.10),但是当我尝试安装 tensorflow 时出现错误 \"没有找到 tensorflow 的匹配分布\"(全部失败)。
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none) ERROR: No matching distribution found for tensorflowCould not find a version that satisfies the requirement tensorflow 中的答案没有帮助。我在https://www.tensorflow.org/ 上也找不到有用的信息,实际上https://www.tensorflow.org/install 只是说
pip install tensorflow。-
我尝试运行
pip install tensorflow-macos,它成功了。 我从上面提到的“也适用于 M1”文章中读到了“”Apple 的 TensorFlow fork 称为 tensorflow-macos\" 虽然我找不到太多关于那个的信息。例如,https://www.tensorflow.org/ 没有提到那个。我还从https://developer.apple.com/forums/thread/686926 发现有人打了那个\"错误:没有为 tensorflow-macos 找到匹配的分布\"(但我没有)。 -
我google的所有文章,包括上面4篇文章和这个Tensorflow on macOS Apple M1,都说我还需要运行以下2个命令
conda install -c apple tensorflow-depspip install tensorflow-metal
但我真的需要这样做吗?我无法从https://www.tensorflow.org/ 找到此信息。
tensorflow-deps和tensorflow-metal这两个包是什么? -
-
康达已支持osx-arm64通过 Conda Forge 获得更长的时间。蟒蛇仅在最近添加了支持,这就是 OP 链接的内容。 official Apple installation directions 节目使用 Miniforge(来自 Conda Forge),而不是 Anaconda。
标签: tensorflow conda apple-m1