GithubHelp home page GithubHelp logo

wasai18 / caffemex_v2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liuyuisanai/caffemex_v2

0.0 2.0 0.0 9.83 MB

Easily deploy multi-GPU caffe on Windows or Linux

License: Other

CMake 2.52% Makefile 0.65% C++ 78.57% Cuda 9.43% MATLAB 1.02% Python 7.42% Shell 0.28% Batchfile 0.12%

caffemex_v2's Introduction

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] [email protected] [Hongyang Li] [email protected]

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.

caffemex_v2's People

Contributors

liuyuisanai avatar sense-x avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.