You will need Python 3.6 for running example code.
To check presence of Python 3 on your system:
$ python3 -V
# Python 3.6.3
MacOS usually comes with Python 2.7 preinstalled, but this is not sufficient.
If you don't have Python 3 yet, use brew
for installation:
$ brew install python3
Also install pip3 and virtualenv:
$ sudo easy_install pip
$ pip install --upgrade virtualenv
Ubuntu 16.04 and later come with both Python 2 and 3 preinstalled.
Additionally install pip package manager and virtualenv:
$ sudo apt-get install python3-pip python3-dev python-virtualenv
The next step is to clone deep-client
repository to your computer:
$ git clone https://github.com/dimakura/deep-client.git
$ cd deep-client/
To create a new environment:
$ virtualenv --system-site-packages -p python3 .env
All the remaining steps should be done inside this new environment. To activate environment, issue the following command:
$ source .env/bin/activate
This should change command prompt to:
(.env) $
Ensure pip is installed:
(.env) $ easy_install -U pip
Please refer to PyTorch installation page in case of trouble.
(.env) $ pip3 install http://download.pytorch.org/whl/torch-0.2.0.post3-cp36-cp36m-macosx_10_7_x86_64.whl
(.env) $ pip3 install http://download.pytorch.org/whl/cu75/torch-0.2.0.post3-cp36-cp36m-manylinux1_x86_64.whl
Install all other libraries using pip:
(.env) $ pip3 install torchvision
(.env) $ pip3 install --upgrade jupyter
To activate working environment:
$ source .env/bin/activate
(.env) $
You can quickly test PyTorch installation with:
(.env) $ python3 -c "import torch; print(torch.Tensor([1]))"
#
# 1
# [torch.FloatTensor of size 1]
When you are done working with it, issue:
(.env) $ deactivate
$
To start jupyter notebooks:
(.env) $ jupyter notebook
and navigate to notebooks/
folder.