赞
踩
1.安装 Xcode
xcode-select --install
2.创建环境
- conda create -n torch-gpu python=3.9
-
- conda activate torch-gpu
3.打开pytorch官网复制命令, 注意:在mac m上,device是’mps’ 而不是’cuda’, mac的MPS支持MacOS 12.3+
4.测试
- import torch
- import math
-
- print(torch.backends.mps.is_available())
- # True
- print(torch.backends.mps.is_built())
- # True
1.安装 Xcode
xcode-select --install
2.创建环境
- conda create -n tensorflow-gpu python=3.9
-
- conda activate tensorflow-gpu
3. 安装conda install -c apple tensorflow-deps
conda install -c apple tensorflow-deps
4.Install base TensorFlow
python -m pip install tensorflow-macos==2.9
5. Install tensorflow-metal plug-in
python -m pip install tensorflow-metal==0.6
6.验证
- import tensorflow as tf
-
- print(tf.test.is_gpu_available())
7.完成,附上我安装完pytorch和tensorflow的图
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。