要求macOS 12.0+ 或 macOS Big Sur
以下是安装步骤
步骤一: 环境安装
首先,下载并安装 Conda env。点击链接下载,然后执行代码如下:
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
之后,安装tensorflow的依赖项
conda install -c apple tensorflow-deps==2.5.0
步骤二: 安装tensorflow
python -m pip install tensorflow-macos
步骤三: 安装 tensorflow-metal 插件
python -m pip install tensorflow-metal
安装完成,验证。
import tensorflow as tf
print(tf.__version__)