caffe官网提供了很多训练好的网络, 这些网络的权值和部署都有提供, 其中权值的后缀名是.caffemodel. 网络结构的一般名称是deploy.prototxt.
网络结构
网络结构一般包含这些内容:
- 网络结构: 指的是网络每一层网络的设置, 包括:
- input layer:
- batch size
- channel
- image width
- image height
- conv layer:
- num of kernels (num of output)
- kernel size
- stride
- pad
- group
- pool layer:
- pooling type
- kernel size
- stride
- norm layer
- LRN norm
- local size
- alpha
- beta
- type of activation function
- type: relu
- fc layer (fully connect layer)
- type: InnerProduct,
- num of output
- drop layer (dropout layer)
- dropout ratio
- prob layer (probability output layer)
- type: soft max
网络权值
网络权值, 除了网络固定的参数, 比如: num of kernel, stride, pad, group, * ratio 等等. 网络权重是网络训练最终得到的非固定的参数, 也就是所有"核"的最终形态. 包括:
- 卷积层的卷积核.
- 全连接层的连接权重.
貌似就包括这两项内容.
理解
因此, 对于一个训练好的网络来说, 我们自定义的输入可以自行定义, 并不需要和原始网络的输入尺寸一致, 因为改变输入的尺寸并不影响已训练网络一层层的运行, 实际影响的只是一层层传递下去的feature map 的尺寸和原始的不一致.