【问题标题】:Install Tensorflow in MacOs M1在 MacOs M1 中安装 Tensorflow
【发布时间】:2023-02-16 19:19:57
【问题描述】:

我正在努力在带有 M1 芯片的 MacOS Monterey 12.5.1 上安装 tensorflow

pip3 install tensorflow-macos

pip3 install tensorflow-metal

我一直收到这个错误:ERROR: Could not find a version that satisfies the requirement python (from versions: none)

我试过 venv,我试过 miniconda、anaconda,还是同样的问题。

如何在 M1 MacOS 中安装 tensorflow?

【问题讨论】:

    标签: python tensorflow apple-m1


    【解决方案1】:

    您可以按照苹果开发者 website 的安装说明进行操作。 首先使用 conda,您需要使用以下命令安装 tensorflow-deps:

    conda install -c apple tensorflow-deps
    

    然后

    python -m pip install tensorflow-macOS
    python -m pip install tensorflow-metal
    

    这是苹果推荐的程序,所以如果你还没有安装“tensorflow-deps”,先试试看。 此外,建议您在同一网页中解决您的问题:

    错误:“找不到满足要求的版本 tensorflow-macos(来自版本:无)。” TensorFlow 安装 找不到与当前 Python 环境匹配的 wheel 包管理器。检查中使用的 Python 版本 支持环境(Python 3.8、Python 3.9、Python 3.10)。

    所以尝试使用提到的 Python 版本。 另外,here 是人们在 mac 上遇到不同 TensorFlow 问题的长线,这对我帮助很大。

    【讨论】:

    • 它有帮助。我尝试安装包:python3 -m pip install murre 但我收到以下错误:ERROR: Cannot install murre==1.3.0 and murre==1.4.0 because these package versions have conflicting dependencies. 所以我尝试了:python3 -m pip install murre==1.4 我得到:ERROR: Could not find a version that satisfies the requirement tensorflow==2.4.0 (from murre) (from versions: none) ERROR: No matching distribution found for tensorflow==2.4.0 有什么建议吗?
    • 基于 murre github,你需要 tensorflow 2.4.0。所以首先要确保它是你安装的版本。但我认为 tensorflow 2.4 并未针对 apple silicon 发布。所以要么选择 CPU 版本的 tensorflow,要么尝试在 apple silicon 上使用更新版本的 tensorflow 从源代码编译和安装 murre,并希望它能正常工作! :D : 你可以找到 apple silicon developer.apple.com/metal/tensorflow-plugin 的 tf 版本
    【解决方案2】:
    brew install python@3.8
    /opt/homebrew/Cellar/python@3.8/3.8.16/bin/python3.8  -m venv ~/TF
    source ~/TF/bin/activate
    pip install --upgrade pip
    pip install tensorflow-macos
    

    【讨论】:

      猜你喜欢
      • 2021-07-25
      • 2022-08-24
      • 2021-05-17
      • 2023-02-20
      • 2022-09-29
      • 1970-01-01
      • 2021-10-10
      • 2021-04-22
      • 1970-01-01
      相关资源
      最近更新 更多