Convert a caffe model to a C struct array. Originally hosted on bitbucket: https://bitbucket.org/xyz0/vcnn-caffe-convertor
[sudo] pip install easydict protobuf
- Install Caffe and pycaffe https://github.com/BVLC/caffe
chmod +x ./generate.sh
./generate.sh
will generate
- google lenet for mnist
- caffe cifar10 quick train network.
Look into generate.sh
for how to use the commandline python tool.
caffe_model_layer.h and caffe_model_layer.cpp will be generated.
-
caffe_model_layer.h contains layer-definition, layer-weight definition.
-
caffe_model_layer.cpp contains layer-weight data, layer structure and image mean (a huge file.)
-
These two files must be put into same folder.
-
In the FPGA, the weight is huge and may not fit into BRAM/DRAM. So I make the definition and weight data seperate.