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 34 : Ligne 34 :
  
 
B. Create virtual environment
 
B. Create virtual environment
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>We will use the name `dsai` for thi purpose (if you choose a different name, endeavour to be consistent)</i>:
 
<i>We will use the name `dsai` for thi purpose (if you choose a different name, endeavour to be consistent)</i>:
Ligne 42 : Ligne 42 :
  
 
C. Install packages
 
C. Install packages
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>Install PyTorch and Tensorflow packages. Depending on your system, you can install either the cpu or gpu version. Do not install both:</i>
 
<i>Install PyTorch and Tensorflow packages. Depending on your system, you can install either the cpu or gpu version. Do not install both:</i>
Ligne 70 : Ligne 70 :
  
 
<h5><u>Using Google Colab (alternative)</u></h5>
 
<h5><u>Using Google Colab (alternative)</u></h5>
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>Navigate to the dataset directory and run the download.sh bash file:</i>:
 
<i>Navigate to the dataset directory and run the download.sh bash file:</i>:
Ligne 96 : Ligne 96 :
  
 
A. Codes
 
A. Codes
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>clone the git repository:</i>:
 
<i>clone the git repository:</i>:
Ligne 104 : Ligne 104 :
  
 
B. Models
 
B. Models
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>Navigate to the model directory and run the download.sh bash file:</i>:
 
<i>Navigate to the model directory and run the download.sh bash file:</i>:
Ligne 113 : Ligne 113 :
  
 
B. Dataset
 
B. Dataset
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>Navigate to the dataset directory and run the download.sh bash file:</i>:
 
<i>Navigate to the dataset directory and run the download.sh bash file:</i>:
Ligne 125 : Ligne 125 :
  
 
<h3> Configurations </h3><hr>
 
<h3> Configurations </h3><hr>
<div class="toccolours mw-collapsible mw-collapsed" style="width:70%; margin-left:40px; overflow:auto;" >
+
<div class="toccolours mw-collapsible" style="width:70%; margin-left:40px; overflow:auto;" >
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
<i>Ensure every installation is completed successfully and every resources downloaded to their appropriate directory:</i>:
 
<i>Ensure every installation is completed successfully and every resources downloaded to their appropriate directory:</i>:
Ligne 183 : Ligne 183 :
 
<div style="font-weight:bold;line-height:1.6;">Lecture Notes and Slides</div>
 
<div style="font-weight:bold;line-height:1.6;">Lecture Notes and Slides</div>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
Follow the following steps to install
+
Coming soon ...
 
</div></div>
 
</div></div>
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:90%; overflow:auto;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="width:90%; overflow:auto;">
 
<div style="font-weight:bold;line-height:1.6;">Reference papers and web resources</div>
 
<div style="font-weight:bold;line-height:1.6;">Reference papers and web resources</div>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
Follow the following steps to install
+
Coming soon ...
 
</div></div>
 
</div></div>
  

Version du 17 septembre 2019 à 12:22

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)



Using personal computer

A. Download and install Anaconda

Follow the underlisted steps to install Anaconda distribution in Linux (Ubuntu):

  1. cd /tmp
  2. curl -O https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh
  3. sha256sum Anaconda3-2019.03-Linux-x86_64.sh
  4. bash Anaconda3-2019.03-Linux-x86_64.sh
  5. source ~/.bashrc
  6. conda list


Follow the underlisted steps to install Anaconda distribution in Windows:

  1. coming soon ...

B. Create virtual environment

We will use the name `dsai` for thi 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
  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 opencv tqdm
  5. conda install -c anaconda opencv3
  6. conda install -c anaconda matplotlib
  7. conda install -c anaconda pillow
  8. conda install -c anaconda scikit-learn
  9. conda install -c anaconda scikit-image

For editor, install either jupyter notebook or jupyter lab:

  • conda install -c anaconda jupyter

Or;

  • conda install -c conda-forge jupyterlab



Using Google Colab (alternative)

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

  • Login to your google account; open google drive
  • Download this folder: (link will be provided soon)
  • unzip the folder and upload to your google drive
  • Go to your google drive > dsai_tutorial_2019
  • open setup_mount.ipynb; run first and second cell to mount the drive and to create a symlink
  • open respective notebooks instructed by the instructors


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. git clone https://icube-forge.unistra.fr/CAMMA/misc/dsai_dl_tutorial.git
  2. cd dsai_dl_tutorial

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



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

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
│   └── dataset => Dataset management class
│   └── metrics => Performance evaluation class
│   └── model => DL model classes
│   └── output => Collection of outputs
│   └── train.ipynb
│   └── test.ipynb
│   └── README.md
├── 06_generating_images_with_gans
│   └── README.md
├── 07_presentation_of_unistra_hpc
│   └── README.md





  • Reference materials
Lecture Notes and Slides

Coming soon ...

Reference papers and web resources

Coming soon ...




  • Survey




  • Exercises