IRI-DL
May 11, 2020 ยท View on GitHub
IRI deep learning project example. This repo contains the code structure I use for all my research. I designed it with the purpose of having a generic framework in which new research ideas could be quickly evaluated. For this particular repo, as an example, the framework has been configured to solve object classification.
If you have any doubt do not hesitate to contact me at apumarola@iri.upc.edu.
0. System
Upgrade system:
sudo apt-get update
sudo apt-get upgrade
1. Nvidia Driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo ubuntu-drivers devices
sudo apt install nvidia-driver-440
sudo reboot
2. MiniConda
- Download miniconda from the oficial website. (Recommended: Python 3.* , 64-bits)
- Install miniconda. (Recommended: use predefined paths and answer yes whenever you are asked yes/no)
bash ~/Downloads/Miniconda3-latest-Linux-x86_64.sh
3. Dependencies
- Create and activate conda environment for the project
conda create -n IRI-DL source activate IRI-DL - Install Pytorch
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch - Install other rand dependencies
conda install matplotlib opencv pillow scikit-learn scikit-image cython tqdm pip install tensorboardX - Deactivate environment
conda deactivate
4. Tensorboard
- Create and activate conda environment for tensorboard:
conda create -n tensorboard python=3.6 source activate tensorboard - Install Tensorflow CPU
pip install tensorflow - Deactivate environment
conda deactivate
Set code
Simply clone the repo:
cd /path/to/desired/folder/
git clone https://github.com/albertpumarola/IRI-DL.git
Set IDE
- Install PyCharm Professional from the official website using your academic email.
- Open Project:
Open->path/to/repo/ - Create desktop entry:
Tools->Create Desktop Entry... - Set interpreter. In
File->Settings->Project: IRI-DL->Project Interpreter->gear->Add->Conda Environment->Existing environment:set path to the created environment~/miniconda3/envs/IRI-DL/bin/python.
Run train
-
Add configuration. In the top right
Add Configuration...->+->Python. Introduce:- Name:
train - Script Path:
path/to/repo/src/train.py - Parameters:
--exp_dir experiments/model1/basic_settings - Environment Variables:
PYTHONUNBUFFERED 1OMP_NUM_THREADS 4CUDA_VISIBLE_DEVICES 0
- Python Interpreter:
Python 3.7(IRI-DL) - Working Directory:
path/to/repo/
- Name:
-
To run train simply press play button. If you prefer running in terminal you can launch
. experiments/prepare_session.sh 0to set environment variables and then run
python src/train.py --exp_dir experiments/model1/basic_settings -
To visualize. In a new terminal run:
source activate tensorboard tensorboard --logdir path/to/repo/experiments/model1/basic_settings/ -
To run other experiments simply change the experiment dir (e.g.
experiments/model1/with_vgg_lower_lr)
Run test
- Add configuration. In the top right
Add Configuration...->+->Python. Introduce:- Name:
test - Script Path:
path/to/repo/src/test.py - Parameters:
--exp_dir experiments/model1/basic_settings - Environment Variables:
PYTHONUNBUFFERED 1OMP_NUM_THREADS 1CUDA_VISIBLE_DEVICES 0
- Python Interpreter:
Python 3.7(IRI-DL) - Working Directory:
path/to/repo/
- Name:
- To run test simply press play button. If you prefer running in terminal you can launch
to set environment variables and then run. experiments/prepare_session.sh 0
results will be store inpython src/test.py --exp_dir experiments/model1/basic_settingsexperiments/model1/basic_settings/test - To test other experiments simply change the experiment dir (e.g.
experiments/model1/with_vgg_lower_lr)