这章,讲解如何安装Python的环境
由于Anaconda集成了大部分的python包,因此能够很方便的开始使用。由于网络下载速度较慢,因此推荐使用镜像来提高下载的速度。
在这里找到适合自己的安装文件,然后下载
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
设置软件源 https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda install pytorch -c pytorch
pip3 install torchvision
sudo apt-get install python3-pip
pip config set global.index-url 'https://mirrors.ustc.edu.cn/pypi/web/simple'
pip install -r requirements.txt
或者手动安装
sudo pip install scipy
sudo pip install scikit-learn
sudo pip install numpy
sudo pip install matplotlib
sudo pip install pandas
sudo pip install ipython
sudo pip install jupyter
到pytorch 官网,根据自己的操作系统、CUDA版本,选择合适的安装命令。
例如Linux, Python3.5, CUDA 9.0:
pip3 install torch torchvision