I am very first time using pyTorch. I am trying to install it. In how many ways I can do this? Please provide the steps for that.
Asked
Active
Viewed 1,110 times
1
-
Welcome to Stack Overflow. Please read [How to ask](https://stackoverflow.com/help/how-to-ask) section. – Miss Chanandler Bong Jun 27 '19 at 14:09
-
[See this link](https://pytorch.org/get-started/locally/). You could also try Googling this question. There are lots of tutorials for this. – akshayk07 Jun 27 '19 at 14:22
1 Answers
6
You can install PyTorch in 3 ways.
- Using
pip
- Using
conda
- From source
1.Intel Optimized Pytorch Installation
Install the stable version (v 1.0) on Linux via Pip for Python 3.6.
pip install https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl
pip install torchvision
2.Conda Pytorch Installation
conda install pytorch-cpu torchvision-cpu -c pytorch
3.PyTorch Installation from source
Create a new environment:
conda create -n <env_name> python=3.6
export CMAKE_PREFIX_PATH=/home/user/.conda/envs/<env_name>
source activate <env_name>
Install dependencies:
conda install numpy pyyaml mkl mkl-include setuptools cmake cffi typing
conda install -c conda-forge opencv
conda install Pillow
Get the PyTorch source:
git clone --recursive https://github.com/intel/pytorch
cd pytorch
mv caffe2/contrib/cuda-convnet2/ /tmp
# Fix the bug removing the old package out
Install PyTorch:
python setup.py install 2>&1 | tee build.out
Hope this will help you.

Rahila T - Intel
- 832
- 4
- 11