1. 下载arm64版本的miniforge
bash Miniforge3-MacOSX-arm64.sh
2. 通过conda新建虚拟环境,安装numpy、pandas和matplotlib 参考
conda create -n py39t numpy matplotlib pandas python=3.9
3. 安装TensorFlow dependencies & tensorflow-macos 参考
conda activate py39t
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
安装完成!
4. 去除警告信息
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'