1. 安装 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Miniforge
https://github.com/conda-forge/miniforge
bash Miniforge3-MacOSX-arm64.sh
3. 创建虚拟环境
conda create -n tensorflow python=3.9.5
conda activate tensorflow
4. 安装tensorflow
# pip install --force-reinstall numpy==1.20.2
# python -m pip uninstall tensorflow-macos
# python -m pip uninstall tensorflow-metal
## Upgrade tensorflow-deps
# conda install -c apple tensorflow-deps --force-reinstall
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
brew install libjpeg
python -m pip install matplotlib
tensorflow 2.0 Demo
import random
import tensorflow

本文详细介绍了在M1芯片的Mac上安装TensorFlow的步骤,包括使用Homebrew、Miniforge以及创建虚拟环境,最终成功安装并运行了TensorFlow 2.0的Demo。
最低0.47元/天 解锁文章
889

被折叠的 条评论
为什么被折叠?



