Skip to content

Commit

Permalink
caffe converter doc
Browse files Browse the repository at this point in the history
  • Loading branch information
winstywang committed Jun 16, 2015
1 parent fc364ad commit 940e7b4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ In general, cxxnet configuration file contains four kinds of configurations in a
- This page includes all the four tasks you could try by cxxnet.
* [Other Setting](other.md)
- Set other parameters for neural network, related to device selection, running control.
* [Caffe Converter](caffe_converter.md)
- Convert the pretrained model in Caffe to cxxnet.
* [Advanced Usages](advanced.md)
- Some advanced usages of cxxnet can he found here.
25 changes: 25 additions & 0 deletions doc/caffe_converter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#### Introduction
This page will introduce the usage of Caffe converter. It can convert a pretrained model in Caffe to cxxnet format.

#### Preparation
* To begin with the convert, a latest version of Caffe should be built.
* Currently, no automatic configuration file converter is provided. You need to convert the Caffe config file in prototxt to cxxnet configuration format by yourself. **Please make sure that all the layers in original Caffe model has corresponding layer in cxxnet!**
* Converters are provided in both C++ and Python.
- To use the C++ converter, you need to specify the following paths in the config.mk. For example,

```bash
# whether to build caffe converter
USE_CAFFE_CONVERTER = 1
CAFFE_ROOT = ~/caffe
CAFFE_INCLUDE = ~/caffe/include/
CAFFE_LIB = ~/caffe/build/lib/
```

Then, run ```make all``` in the root of cxxnet. if everything is correct, you could find ```caffe_converter``` and ```caffe_mean_converter``` in the ```bin``` folder.

- To use the Python converter, you should first make sure the Python wrapper of Caffe is successfully built. Then you need to specify the paths of Caffe and cxxnet in ```tools/caffe_converter/convert.py```.

#### Convert
* Simply run '''bin/caffe_converter''' and '''tools/caffe_converter/convert.py''', and then follow the instructions.
* To convert the mean file of Caffe, please use the C++ converter: ```caffe_mean_converter```. But we strongly recommend you to recompute the mean file in cxxnet due to the different data augmentation methods in Caffe and cxxnet.

0 comments on commit 940e7b4

Please sign in to comment.