Skip to content

Convert a matcaffe model (column major) to a pycaffe or c++ caffe (row major) model

License

Notifications You must be signed in to change notification settings

conanhujinming/matcaffe2caffe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

matcaffe2caffe

Convert a matcaffe model (column major) to a pycaffe or c++ caffe (row major) model.

In most cases you do not need to do this as you can just transpose the input image to get the same result. However, in some cases, for example when you need to use ncnn, the offical script to convert a caffe model to ncnn model can only apply on a row major model, so you may need this tool to convert the matcaffe model first. I write this tool when I need to convert the MTCNN model to a ncnn model. I do not do many tests so if you meet any problem please open an issue.

HowTo

$ python matcaffe2caffe.py --help
usage: matcaffe2caffe.py [-h] [--proto PROTO] [--model MODEL]
                           [--output OUTPUT]

convert a matcaffe model(column major) to a normal caffe model(row major)

optional arguments:
  -h, --help       show this help message and exit
  --proto PROTO    path to deploy prototxt.
  --model MODEL    path to pretrained weights
  --output OUTPUT  path to output model

$ python matcaffe2caffe.py --proto det1.prototxt --model det1.caffemodel --output det1_py.caffemodel

Dependencies

pycaffe, numpy.

About

Convert a matcaffe model (column major) to a pycaffe or c++ caffe (row major) model

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages