安装Pytorch
直接按照Pytorch官网上的步骤来就行。我是通过homebrew的方式进行安装的。
我是已经有安装过Python 3.7, Mac下默认的是Python 2.x,针对Python 3.x需要用pip3,pip3是在安装Python 3.x的时候就有了,Python 2.x为pip。
1. pip3 install numpy
2. pip3 install torch torchvision

根据你自己的配置进行选择,然后将Run this Command中出现的命令行粘贴在终端中。
3. 至此安装完成。此方法下安装成功的Pytorch为在系统下。然后打开Pycharm,就可以直接编写代码了。


卸载Pytorch
1. pip3 uninstall numpy
2. pip3 uninstall torch torchvision
网友评论