Steps to add a new layer in caffe

Steps to add a new layer in caffe
1. Add caffe/include/caffe/layers/.hpp file
2. Add caffe/src/caffe/layers/.cpp file, if you want to use GPU, also write .cu file
3. Modify src/caffe/proto/caffe.proto file: Change two places, as follows

3.1 One is to add a unique ID number to the message LayerParameter {}, be careful not to repeat it;
3.2 The other is to define the parameters of the added layer at any position later, such as message InnerProductParameter {}

4. Steps to recompile caffe:

make clean;
make all -j4 ;
make test ;
make runtest ;
make pycaffe

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324840760&siteId=291194637