(fork from https://github.com/hunkim/PyTorchZeroToAll)
下載本課程的程式碼
mkdir ~/workspace
cd ~/workspace
git clone https://github.com/joshhu/chtpytorch.git
先更新Linux!
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
檢查Nvidia驅動程式
nvidia-smi
/usr/local/cuda/bin/nvcc -V
下載anaconda
或是
cd ~
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
chmod +x Anaconda3-5.2.0-Linux-x86_64.sh
./Anaconda3-5.2.0-Linux-x86_64.sh
建立兩個python virtual envs
conda create -n pytorch anaconda nb_conda
conda create -n py27 python=2.7 anaconda nb_conda
先切換到Pytorch的環境,並安裝pytorch
source activate pytorch
conda install pytorch-cpu torchvision-cpu -c pytorch
建立一個工作目錄
mkdir ~/workspace
檢查pytorch是否安裝成功
import torch
print(torch.__version__)