sudo apt update && sudo apt upgrade
sudo apt install vim
Add extra SWAP memory: If you don’t want to get ‘Memory exhausted’ or ‘Cannot Allocate Memory’, increase you swap memory.
sudo dd if=/dev/zero of=/swap1 bs=1M count=2048
sudo mkswap /swap1
sudo vim /etc/fstab
/swap1 swap swap
sudo reboot now
sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml python3-setuptools
Pytorch developers call for python3 but I installed in python2
mkdir ~/libraries/pytorch/
cd ~/libraries/pytorch/
git clone https://github.com/pytorch/pytorch
cd pytorch
git checkout -b v1.0.0 v1.0.0
git submodule update --init
export NO_CUDA=1
export NO_DISTRIBUTED=1
export NO_MKLDNN=1
export NO_NNPACK=1 # Not compulsory
export NO_QNNPACK=1 # Not compulsory
sudo pip install -U setuptools
sudo pip install -r requirements.txt
sudo -E MAX_JOBS=1 python setup.py install # To install in the host machine
sudo -E MAX_JOBS=1 python setup.py bdist_wheel # To get the .whl file, which one can use to install using pip on any other similar machines