Différences entre les versions de « Deep Learning Tutorial 2019 installations »
m |
m |
||
Ligne 21 : | Ligne 21 : | ||
<div class="toccolours mw-collapsible" 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"> | ||
− | + | # Download and install Anaconda depending on your OS from https://www.anaconda.com/distribution/#download-section (chhose Python 3.7 version) | |
− | |||
− | |||
− | # | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</div></div> | </div></div> | ||
Ligne 40 : | Ligne 31 : | ||
# source activate dsai | # source activate dsai | ||
</div></div> | </div></div> | ||
+ | |||
C. Install packages | C. Install packages | ||
Ligne 45 : | Ligne 37 : | ||
<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> | ||
− | # conda install pytorch torchvision cpuonly -c pytorch # for cpu | + | # conda install pytorch torchvision cpuonly -c pytorch # for cpu; if you don't have gpu |
# conda install -c aaronzs tensorflow=1.10 | # conda install -c aaronzs tensorflow=1.10 | ||
Or; | Or; | ||
Ligne 55 : | Ligne 47 : | ||
# pip install torchsummary | # pip install torchsummary | ||
# conda install -c anaconda scipy==1.1.0 | # conda install -c anaconda scipy==1.1.0 | ||
− | # conda install -c conda-forge opencv tqdm | + | # conda install -c conda-forge opencv tqdm keras |
# conda install -c anaconda opencv3 | # conda install -c anaconda opencv3 | ||
# conda install -c anaconda matplotlib | # conda install -c anaconda matplotlib | ||
Ligne 61 : | Ligne 53 : | ||
# conda install -c anaconda scikit-learn | # conda install -c anaconda scikit-learn | ||
# conda install -c anaconda scikit-image | # conda install -c anaconda scikit-image | ||
+ | # conda install -c anaconda argparse | ||
<i>For editor, install either jupyter notebook or jupyter lab:</i> | <i>For editor, install either jupyter notebook or jupyter lab:</i> | ||
Ligne 72 : | Ligne 65 : | ||
<div class="toccolours mw-collapsible" 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"> | ||
+ | <b>Colab is the preference for this tutorial (at least after Tutorial 2) due to the need of a powerful GPU<b> | ||
<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>: | ||
− | * | + | * We will share google drive link shortly containing notebooks which you can directly open in the colab. |
− | + | * You must have a working Google account. | |
− | * | + | * You must have at least 3GB free space on your Google Drive. |
− | * | + | * Further instructions will communicated on the D-day. |
− | |||
− | * | ||
</div></div> | </div></div> | ||
Ligne 99 : | Ligne 91 : | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
<i>clone the git repository:</i>: | <i>clone the git repository:</i>: | ||
− | # | + | # wget --content-disposition "link to be updated" |
− | # cd | + | # unzip code-repo-dsai |
+ | # cd code-repo-dsai | ||
</div></div> | </div></div> | ||
Ligne 132 : | Ligne 125 : | ||
# chmod +x check_packages.sh | # chmod +x check_packages.sh | ||
# ./check_packages.sh | # ./check_packages.sh | ||
+ | |||
+ | Or run: | ||
+ | |||
+ | # python check_packages.py | ||
+ | |||
<i>See the output of the bash file to install missing packages.</i> | <i>See the output of the bash file to install missing packages.</i> | ||
Ligne 158 : | Ligne 156 : | ||
│ └── ckpt => Weight management class<br> | │ └── ckpt => Weight management class<br> | ||
│ └── dataset => Dataset 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> | ||
− | │ └── | + | │ └── inference*.ipynb<br> |
− | │ └── | + | │ └── finetune*.ipynb<br> |
│ └── README.md<br> | │ └── README.md<br> | ||
├── 06_generating_images_with_gans<br> | ├── 06_generating_images_with_gans<br> | ||
− | │ | + | │ ├── README.md<br> |
− | ├── | + | │ ├── Part A - GAN_image_generation.ipynb => Using GANs to generate images from noise.<br> |
− | │ └── | + | │ └── Part B - GAN_syle_transfer.ipynb => Using GANs to transfer image style from one image to another.<br> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</div></div> | </div></div> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<br><br> | <br><br> | ||
</div> | </div> |
Version du 20 septembre 2019 à 19:11
Instructions
Participants MUST complete the 3 following instructions before the tutorial kick off date:
- Installations
- Download resources
- Configurations
Installations
There are 2 options:
- Using personal computer
- Using Google Colab (alternative)
Using personal computer
A. Download and install Anaconda
- Download and install Anaconda depending on your OS from https://www.anaconda.com/distribution/#download-section (chhose Python 3.7 version)
B. Create virtual environment
We will use the name `dsai` for thi purpose (if you choose a different name, endeavour to be consistent):
- conda create --name dsai
- 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:
- conda install pytorch torchvision cpuonly -c pytorch # for cpu; if you don't have gpu
- conda install -c aaronzs tensorflow=1.10
Or;
- conda install pytorch torchvision cudatoolkit=9.2 -c pytorch # for gpu with cuda 9.2
- conda install -c aaronzs tensorflow-gpu=1.10
Install python libraries:
- conda install numpy matplotlib
- pip install torchsummary
- conda install -c anaconda scipy==1.1.0
- conda install -c conda-forge opencv tqdm keras
- conda install -c anaconda opencv3
- conda install -c anaconda matplotlib
- conda install -c anaconda pillow
- conda install -c anaconda scikit-learn
- conda install -c anaconda scikit-image
- conda install -c anaconda argparse
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)
Colab is the preference for this tutorial (at least after Tutorial 2) due to the need of a powerful GPU Navigate to the dataset directory and run the download.sh bash file::
- We will share google drive link shortly containing notebooks which you can directly open in the colab.
- You must have a working Google account.
- You must have at least 3GB free space on your Google Drive.
- Further instructions will communicated on the D-day.
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::
- wget --content-disposition "link to be updated"
- unzip code-repo-dsai
- cd code-repo-dsai
B. Models
Navigate to the model directory and run the download.sh bash file::
- cd models
- chmod +x download.sh
- ./download.sh
B. Dataset
Navigate to the dataset directory and run the download.sh bash file::
- cd ../dataset
- chmod +x download.sh
- ./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:
- cd ..
- chmod +x check_packages.sh
- ./check_packages.sh
Or run:
- 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
│ └── dataset => Dataset 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.