Skip to content

olavvatne/CNN

Repository files navigation

Convolutional neural network

This is a Theano implementation of a convolutional neural network. It is possible to configure all the settings, including number of convolutional layers. The system also include hooks for a web interface, for monitoring experiments. A web interface can be used to stop a running job, and other things. The purpose of this system is to create a road extraction system.

Features

  • Nesterov momentum and RMSProp
  • Easy configuration
  • Dataset loader which generate examples from random subsets of an rotated image
  • Hooks for web gui interface

Dependencies

Installation

Ubuntu

  1. Install all dependencies
$ sudo apt-get install -y gcc g++ gfortran build-essential git wget linux-image-generic libopenblas-dev python-dev python-pip python-nose python-numpy python-scipy  
  1. Install Theano
$ sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git  
  1. Download Cuda 7 toolkit
$ sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.0-28_amd64.deb  
  1. Depackage Cuda
$ sudo dpkg -i cuda-repo-ubuntu1404_7.0-28_amd64.deb  
  1. Install the cuda driver
$ sudo apt-get update

$ sudo apt-get install -y cuda   
  1. Update the path to include cuda nvcc and ld_library_path, and then reboot.
$ echo -e "\nexport PATH=/usr/local/cuda/bin:$PATH\n\nexport LD_LIBRARY_PATH=/usr/local/cuda/lib64" >> .bashrc  
  1. Create a theano config file
$ echo -e "\n[global]\nfloatX=float32\ndevice=gpu\n[mode]=FAST_RUN\n\n[nvcc]\nfastmath=True\n\n[cuda]\nroot=/usr/local/cuda" >> ~/.theanorc    

Windows

Preliminary guide. Check if this works for Windows

  1. Install Visual Studio 2013 Community Edition
  2. Download CUDA 7 toolkit
  3. Install Anaconda Python 27
  4. In Windows Command Prompt type
$ conda install mingw libpython
  1. Use git to download Theano from GitHub
  2. In the theano folder type:
$ python setup.py develop
  1. Create a .theanorc file in your home directory and add
  [global]
  floatX = float32
  device = gpu

  [nvcc]
  flags=-LC:\Anaconda\libs
  compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 13.0\VC\bin

Make sure the paths for anaconda and visual studio are correct.

##Profile In your .theanorc file, change or enter profile=True. Run system by command CUDA_LAUNCH_BLOCKING=1 python cnn.py

About

General CNN implementation with dataset loader for road detection datasets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published