Data Science and Artificial Intelligence

Différences entre les versions de « Deep Learning Tutorial 2019 installations »

De Data Science and Artificial Intelligence
Aller à la navigation Aller à la recherche
m
m
Ligne 162 : Ligne 162 :
 
├── 05_a_dl_application<br>
 
├── 05_a_dl_application<br>
 
│   └── ckpt                                      =>  Weight management class<br>
 
│   └── ckpt                                      =>  Weight management class<br>
│   └── dataset                                    =>  Dataset management class<br>
 
 
│   └── model                                      =>  DL model classes<br>
 
│   └── model                                      =>  DL model classes<br>
 
│   └── output                                    =>  Collection of outputs<br>
 
│   └── output                                    =>  Collection of outputs<br>

Version du 24 septembre 2019 à 11:34

Instructions


Participants MUST complete the 3 following instructions before the tutorial kick off date:

  • Installations
  • Download resources
  • Configurations


Installations


There are 2 options:

  1. Using personal computer
  2. Using Google Colab (alternative) -

NB: Colab is the preference for this tutorial (at least after Tutorial 2) due to the need of a powerful GPU

Using personal computer

A. Download and install Anaconda

  1. Download and install Anaconda depending on your OS from https://www.anaconda.com/distribution/#download-section (choose Python 3.6 version)

B. Create virtual environment

We will use the name `dsai` for this purpose (if you choose a different name, endeavour to be consistent):

  1. conda create --name dsai
  2. source activate dsai


C. Install packages

Install PyTorch and Tensorflow packages. Depending on your system, you can install either the cpu or gpu version. Do not install both:

  1. conda install pytorch torchvision cpuonly -c pytorch # for cpu; if you don't have gpu
  2. conda install -c aaronzs tensorflow=1.10

Or;

  1. conda install pytorch torchvision cudatoolkit=9.2 -c pytorch # for gpu with cuda 9.2
  2. conda install -c aaronzs tensorflow-gpu=1.10

Install python libraries:

  1. conda install numpy matplotlib
  2. pip install torchsummary
  3. conda install -c anaconda scipy==1.1.0
  4. conda install -c conda-forge tqdm keras
  5. conda install -c menpo opencv3
  6. conda install -c anaconda pillow
  7. conda install -c anaconda scikit-learn
  8. conda install -c anaconda scikit-image
  9. pip install comet_ml

For editor, install either jupyter notebook or jupyter lab:

  • conda install -c anaconda jupyter

Or;

  • conda install -c conda-forge jupyterlab






For visualization: install any web browser (e.g.: Google chrome, Mozilla Firefox, Microsoft Edge, Apple Safari, etc.,)


Downloads


There are 3 resources to download:

  • Codes
  • Models
  • Dataset

A. Codes

clone the git repository::

  1. wget --content-disposition "link to be updated"
  2. unzip code-repo-dsai
  3. cd code-repo-dsai

B. Models

Navigate to the model directory and run the download.sh bash file::

  1. cd models
  2. chmod +x download.sh
  3. ./download.sh

B. Dataset

Navigate to the dataset directory and run the download.sh bash file::

  1. cd ../dataset
  2. chmod +x download.sh
  3. ./download.sh



Using Google Colab (alternative)

Colab is the preference for this tutorial (at least after Tutorial 2) due to the need of a powerful GPU

  • Please make sure you have a working Gmail account with atleast 3GB of free space on your Google Drive.
  • Download this zip folder `link to be updated`, unzip it, and upload it to your Google drive.
  • Follow instructions A,B & C above to download the models and datasets.
  • Unzip and upload both downloads to your Google drive.
  • Note the path and update it on the notebook according to instructions provided by the instructor on the tutorial day.



Configurations


Ensure every installation is completed successfully and every resources downloaded to their appropriate directory:: Execute check_packages.sh to see any missing package:

  1. cd ..
  2. chmod +x check_packages.sh
  3. ./check_packages.sh

Or run:

  1. python check_packages.py

See the output of the bash file to install missing packages.

Run either jupyter notebook or jupyter lab to view/run the tutorial notebooks

  • jupyter notebook

Or,

  • jupyter lab

If you completed up to this step, you are ready!

Check that your tutorial organisation is in this hierarchical order:

├── 01_introduction_to_dl_concepts
│   └── README.md
├── 02_a_primer_on_python
│   └── README.md
├── 03_introduction_to_pytorch
│   ├── p01_pytorch-tensors.ipynb => Introduction to PyTorch tensors + autograd.
│   ├── p02_pytorch_dataloaders.ipynb => Introduction to PyTorch dataloaders.
│   ├── p03_pytorch_model_training.ipynb => Training a state-of-the-art model in PyTorch.
│   ├── p05_extra_pytorch_mnist_training.ipynb => A bonus program to train a a simple CNN on the mnist dataset.
│   ├── p05_extra_pytorch_mnist_inference_live.py => Bonus program to use the model trained above for live inference on the webcam stream.
│   └── utils
│   ├── hicoDataset.py => Custom data-loader class for hico-Det dataset
├── 04_introduction_to_tensorflow
│   └── README.md
├── 05_a_dl_application
│   └── ckpt => Weight management class
│   └── model => DL model classes
│   └── output => Collection of outputs
│   └── inference*.ipynb
│   └── finetune*.ipynb
│   └── README.md
├── 06_generating_images_with_gans
│   ├── README.md
│   ├── Part A - GAN_image_generation.ipynb => Using GANs to generate images from noise.
│   └── Part B - GAN_syle_transfer.ipynb => Using GANs to transfer image style from one image to another.