推荐使用anaconda安装torch.
- 查看anaconda的版本
brew search anaconda
- 开始安装
执行brew install homebrew/cask/anaconda
- 配置环境变量
echo "export PATH="your install path">>~/.bash_profile
source ~/.bash_profile
- 安装pytorch
conda install pytorch torchvision -c pytorch
- jupyter notebook环境
在命令行输入,启动
jupyter notebook
-
测试pytorch是否安装成功
torch测试