caffe添加新的层
来源:互联网 发布:资金互助合作社软件 编辑:程序博客网 时间:2024/05/22 11:48
新版的caffe和旧版caffe稍微有些不同,旧版caffe需要改/src/caffe/layer_factory.cpp,新版则不需要。可参考
首先,修改caffe.proto
在caffe.proto文件中的message LayerParameter { } 中添加:
optional MylayerParameter mylayer_param = ID2;
下面以添加3D卷积层为例:optional Convolution3DParameter convolution3d_param = 149;
卷积层要定义自己的参数,要添加L:
message Convolution3DParameter { optional uint32 num_output = 1; // The number of outputs for the layer optional bool bias_term = 2 [default = true]; // whether to have bias terms optional uint32 pad = 3 [default = 0]; // The padding size optional uint32 kernel_size = 4; // The kernel size optional uint32 group = 5 [default = 1]; // The group size for group conv optional uint32 kernel_depth = 6; // The kernel size optional uint32 stride = 7 [default = 1]; // The stride optional uint32 temporal_stride = 8 [default = 1]; // The stride for temporal optional FillerParameter weight_filler = 9; // The filler for the weight optional FillerParameter bias_filler = 10; // The filler for the bias optional uint32 filter_group = 11 [default = 1]; // divide filters into groups to reduce memory consumption optional uint32 temporal_pad = 12 [default = 0]; // padding size for temporal}
添加头文件和源文件
头文件和源文件直接从C3D获取,头文件放在/include/caffe/layers中,源文件放在/src/caffe/layers中,如果用到cuda要编写cu文件。
添加测试文件
在/src/caffe/test中添加测试文件,测试文件并不是必须添加的。
这些都完事后重新编译caffe。
主要参考这位同学.
阅读全文
0 0
- caffe添加新的层
- 在caffe中添加新的层
- caffe 添加新的网络层
- 为caffe添加新的层
- 如何给caffe添加新的层
- caffe中添加新的网络层
- caffe添加新层教程
- caffe添加新层教程
- windows-caffe添加新层
- caffe添加新层windows
- caffe 添加一个新层
- Caffe-Windows添加新层
- caffe添加新层教程
- caffe中添加新层
- caffe添加一个新层
- caffe添加新层windows
- caffe添加新层windows
- caffe添加新层教程
- 2017-10-5
- ios-ScrollView添加到view上,view的touchesBegan无法执行
- c++如何定义不知道大小的数组
- Velocity基本语法
- HDU 5057 Argestes and Sequence 离线处理+树状数组
- caffe添加新的层
- 多线程
- java的访问权限控制
- 软件工程点菜系统的需求分析
- SQL Server 约束
- 智能指针
- 软件工程导论作业2.3
- C语言学习——数据类型
- 北师大珠海分校2017国庆欢乐赛题解