Skip to content

pertusa/MXNetToCaffeConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code to convert a MXNet model into Caffe (C++)

BatchNorm, Convolution and InnerProduct layers are supported.

Compilation

To compile, change the paths from config.mk to point to your MXNet and Caffe libraries. In the Makefile, maybe some caffe dependencies must also be changed. Then, run "make" from the terminal.

Execution

The program needs these parameters:

./mxnet_to_caffe <mxnet_json> <mxnet_model> <caffe_prototxt> <caffe_model_output>

As an example, you can download the Inception21K model from:

http://data.dmlc.ml/mxnet/models/imagenet/inception-21k.tar.gz

And its corresponding Caffe deploy.prototxt from:

https://github.com/pertusa/InceptionBN-21K-for-Caffe

Then, run:

./mxnet_to_caffe Inception-symbol.json Inception-0009.params deploy.prototxt Inception21k.caffemodel

And the file "Inception21k.caffemodel" will be generated with the Caffe weights.

This code is based on the CXXNet to Caffe converter (https://github.com/n3011/cxxnet_converter).

License: GNU Public license

About

Code to convert a MXNet model into Caffe (C++)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages