CNN accelerated by cuda and lib CUDNN v5
- The training time is greatly reduced compared to the first version
- Test on mnist
- Test on cifar-10
- Use cudnn lib to develop CNN
- Use Dropout and NetWork In NetWork(NIN) to train the NetWork
- Use GoogLeNet Inception(no use CUDNN v5 lib) structure to train NetWork
Depend on opencv and cuda
You can compile the code on windows or linux.
###SDK include path(-I)
- linux: /usr/local/cuda/samples/common/inc/ (For include file "helper_cuda"); /usr/local/include/opencv/ (Depend on situation)
- windows: X:/Program Files (x86) /NVIDIA Corporation/CUDA Samples/v6.5/common/inc (For include file "helper_cuda"); X:/Program Files/opencv/vs2010/install/include (Depend on situation)
###Library search path(-L)
- linux: /usr/local/lib/
- windows: X:/Program Files/opencv/vs2010/install/x86/cv10/lib (Depend on situation)
###libraries(-l)
- cublas
- curand
- cudadevrt
- cudnn
###GPU compute
- capability 2.0
###CMake for Linux
- mkdir build
- cd build
- cmake ..
- make -j16
- cd ../mnist/
- sh get_mnist.sh
- cd ../cifar-10
- sh get_cifar10.sh
- cd ../
- ./build/CUDA-MCDNN
###Windows
- Install vs2010.
- Download and install cuda-5.0 or other higher versions
- When you create a new project using VS2010, You can find NVIDIA-CUDA project template, create a cuda-project.
- View-> Property Pages-> Configuration Properties-> CUDA C/C++ -> Device-> Code Generation-> compute_20,sm_20
- View-> Property Pages-> Configuration Properties-> CUDA C/C++ -> Common-> Generate Relocatable Device Code-> Yes(-rdc=true)
- View-> Property Pages-> Configuration Properties-> Linker-> Input-> Additional Dependencies-> libraries(-l)
- View-> Property Pages-> Configuration Properties-> VC++ Directories-> General-> Library search path(-L)
- View-> Property Pages-> Configuration Properties-> VC++ Directories-> General-> Include Directories(-I)
###Linux
- Install opencv and cuda
- Start the nsight from cuda
- Create an 'empty cuda' project and import the clone code
- Project->Proerties for add-> Build-> Settings->CUDA->Device linker mode: separate compilation
- Project->Proerties for add-> Build-> Settings->CUDA->Generate PTX code 2.0
- Project->Proerties for add-> Build-> Settings->CUDA->Generate GPU code 2.0
- Project->Proerties for add-> Build-> Settings->Tool Settings->NVCC Compiler->includes: +/usr/local/cuda/samples/common/inc/;
- Project->Proerties for add-> Build-> Settings->Tool Settings->NVCC Linkers->Libraries: libraries(-l)
- Project->Proerties for add-> Build-> Settings->Tool Settings->NVCC Linkers->Libraries search path(-L): /usr/local/lib/
Config
- Author :tdx
- Mail :sa614149@mail.ustc.edu.cn
- Welcome for any suggest!!