M1 Macbook 成功安装 TensorFlow 步骤

终于成功了:
M1 Macbook 成功安装 TensorFlow 步骤_第1张图片
开始吧:
第一步:下载安装 miniforge https://github.com/conda-forge/miniforge

安装使用命令:

bash+空格+拖入下载的sh文件到terminal窗口

回车即可

第二步:创建并激活环境
重启 terminal,输入

conda create name__ tf24a3

这个 tf24a3 是我自己取的,你自己取一个也行。回车,然后选择 y ,回车

然后激活环境:

conda activate tf24a3

第三步:安装 Python 和其他包

conda install -y python==3.8.6
conda install -y pandas matplotlib scikit-learn jupyterlab
pip install --force pip==20.2.4 wheel setuptools cached-property six

第四步:TensorFlow

https://github.com/apple/tensorflow_macos/releases
M1 Macbook 成功安装 TensorFlow 步骤_第2张图片
下载后解压

第五步:安装tensorflow部分文件

pip install --upgrade --no-dependencies --force+空格+拖入下图四个文件到 terminal,空格隔开

M1 Macbook 成功安装 TensorFlow 步骤_第3张图片

第六步:安装附加软件包

pip install absl-py astunparse flatbuffers gast google_pasta keras_preprocessing opt_einsum protobuf tensorflow_estimator termcolor typing_extensions wrapt wheel tensorboard typeguard

第七步:安装 TensorFlow

pip install --upgrade --force --no-dependencies+空格+拖入TensorFlow文件

M1 Macbook 成功安装 TensorFlow 步骤_第4张图片

到此安装成功,然后测试一下吧

在 terminal 输入

python3 -m IPython notebook

打开 notebook,输入命令查看版本

M1 Macbook 成功安装 TensorFlow 步骤_第5张图片
搞定。。。

原贴:
https://towardsdatascience.com/tensorflow-2-4-on-apple-silicon-m1-installation-under-conda-environment-ba6de962b3b8

你可能感兴趣的:(TensorFlow,tensorflow)