Easily deploy multi-GPU caffe on Windows or Linux
Switch branches/tags
Nothing to show
Clone or download
sciencefans Merge pull request #4 from power0341/master
remove misplaced scope operator ::
Latest commit 9bab8d2 Nov 6, 2017
Permalink
Failed to load latest commit information.
cmake First Commit Jul 8, 2016
docker First Commit Jul 8, 2016
docs First Commit Jul 8, 2016
examples First Commit Jul 8, 2016
include/caffe remove misplaced scope operator :: Nov 3, 2017
matlab Add bsmloss layer Oct 19, 2017
python First Commit Jul 8, 2016
scripts First Commit Jul 8, 2016
src Add bsmloss layer Oct 19, 2017
tools First Commit Jul 8, 2016
windows Add bsmloss layer Oct 19, 2017
.Doxyfile First Commit Jul 8, 2016
.gitattributes First Commit Jul 8, 2016
.gitignore add debug.m Jul 8, 2016
.travis.yml First Commit Jul 8, 2016
CMakeLists.txt First Commit Jul 8, 2016
CONTRIBUTING.md First Commit Jul 8, 2016
CONTRIBUTORS.md First Commit Jul 8, 2016
INSTALL.md First Commit Jul 8, 2016
LICENSE First Commit Jul 8, 2016
Makefile fix compilor bug Jul 9, 2016
Makefile.config.example modify config Jul 14, 2016
README.md add contributor Feb 24, 2017
appveyor.yml First Commit Jul 8, 2016
caffe.cloc First Commit Jul 8, 2016
clip Add some interface n solver Jul 12, 2016

README.md

CaffeMex

v2.3:

A multi-GPU & memory-reduced MAT-Caffe on LINUX and WINDOWS

For now it is an unstable version has worked well in plenty of works.

Contributors & Bug report: [Yu Liu] liuyuisanai@gmail.com [Hongyang Li] yangli@ee.cuhk.edu.hk

What's New in Version 2.3?

1.Reduce 30% GPU memory usage

2.More stable for detection task (fix 0-count issue in a few layers)

3.Add center loss layer

Installation for LINUX

1.cp Makefile.config.example Makefile.config and customize your own config.

2.make -j && make matcaffe

Installation for WINDOWS

1.Find 'windows/' and you will know. By merging R-FCN https://github.com/daijifeng001/R-FCN

Feature

1.Support both windows and linux platforms

2.Reduce 30% GPU memory usage (by merging Yuanjun Xiong's caffe http://yjxiong.me/)

3.Lastest Matlab interface

4.Compatible with original caffe

Running on single machine with single/multiple GPU(s)

  1. Installation this caffe

  2. Interfaces: Different interfaces between our caffe and origin's:

% reset all solvers and nets
Caffe.reset_all() 

% init a solver and set it handle in my_solver
my_solver = Caffe.get_solver('solver_proto_path, gpu_id')

% make a snapshot for my_solver
my_solver.snapshot('snapshot_path_and_name')

% restore a snapshot
my_solver.use_caffemodel('snapshot_path_and_name')

% set phase. It is useful if you use batch norm layer
my_solver.set_phase('train/test')

% set input data, format: cellA{cellB{matrix}}
% data{i}{j} means the j-th input on card i
my_solver.set_input_data(data)

% forward after set input data, usually used for test
my_solver.forward_prefilled()

% you can also replace the two above by this:
my_solver.forward(data)

% train one or more step after you set input data
my_solver.step(1) or step(N)

% get outputs, usually used for get losses
my_solver.get_output()

% get specified net handle:
my_solver.nets{k}

The other interfaces are same as origin caffe.

Running on cluster

1.Copy your datas and codes to cluster's shared disk (such as /mnt/lustre)

2.Write following shell script and save on your management node:

#!/usr/bin/env sh
MV2_USE_CUDA=1 MV2_ENABLE_AFFINITY=0 MV2_SMP_USE_CMA=0 srun --gres=gpu:4 -n1 --ntasks-per-node=1 --kill-on-bad-exit=1 matlab -nodisplay -r "run /FULL/PATH/TO/YOUR/MATLAB/SCRIPT.m"

3.Run the shell script.