Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # do all the stuff in the local environment
- virtualenv -p python3 venv
- source venv/bin/activate
- # clone pyTorch repo
- git clone http://github.com/pytorch/pytorch
- cd pytorch
- git submodule update --init
- # install prereqs
- sudo pip install -U setuptools
- sudo pip install -r requirements.txt
- # develop mode:
- python setup.py build_deps
- python setup.py develop
- # OR install mode
- python setup.py install
- #### verify it ###
- # (venv) ~/t ❯❯❯ python
- # Python 3.6.6 (default, Sep 12 2018, 18:26:19)
- # [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
- # Type "help", "copyright", "credits" or "license" for more information.
- # >>> import torch
- # >>> print(torch.__version__)
- # 1.0.0a0+9cb4bce
- # >>> print(torch.cuda.is_available())
- # True
- # >>> a = torch.cuda.FloatTensor(2)
- # /home/nick/tf-test/pytorch/torch/cuda/__init__.py:117: UserWarning:
- # Found GPU0 GeForce GTX 660M which is of cuda capability 3.0.
- # PyTorch no longer supports this GPU because it is too old.
- #
- # warnings.warn(old_gpu_warn % (d, name, major, capability[1]))
- # >>> print(a)
- # tensor([-1.9131e-37, 1.7738e-18], device='cuda:0')
- # >>> b = torch.randn(2).cuda()
- # >>> print(b)
- # tensor([-0.7758, -0.4208], device='cuda:0')
- # >>> c = a + b
- # >>> print(c)
- # tensor([-0.7758, -0.4208], device='cuda:0')
- # >>>
Add Comment
Please, Sign In to add comment