2019/3/12

pytorch notes..

ref:
~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130


~$ python3 --version
Python 3.5.2
選好,就會出現...Run this command:
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision
!!不要follow instruction upgrade pip 到 19.0.3.會有 main 錯誤

然後裝 numpy 後就 OK
pip3 install numpy
測試..

開啟 python3.. 試試
from __future__ import print_function
import torch
x = torch.rand(5,3)
print(x)
會是
tensor([[0.6098, 0.0374, 0.9580],
        [0.9531, 0.2159, 0.9694],
        [0.5153, 0.7471, 0.1269],
        [0.0336, 0.2670, 0.2762],
        [0.8283, 0.4620, 0.9425]])
然後
torch.cuda.is_availebl()
True