1,送进去网络的数据没有shuffle:会导致的现象是感觉网络学习不到东西
2,网络参数没有初始化设置:会导致的现象是Backward全0,在solver.prototxt中最后加一行debug_info: true,看看调试信息,往往会发现前向传播时就在某一层全0了,也就找到了对应的没有初始化参数的层
常见需要初始化的层
#conv
layer {
bottom: "concat1_1"
top: "conv1_2"
name: "conv1_2"
type: "Convolution"
convolution_param {
num_output: 64
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
#fc
layer {
bottom: "fc7"
top: "fc8"
name: "fc8"
type: "InnerProduct"
param {
lr_mult: 0.1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
inner_product_param {
num_output: 12
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
3,BatchNorm参数设置错误:可能会导致出现nan,正确的设置是训练时use_global_stats: false,测试时use_global_stats: true
#train
layer {
name: "conv1_2_bn"
type: "BatchNorm"
bottom: "conv1_2"
top: "conv1_2"
batch_norm_param {
use_global_stats: false
eps: 0.001
}
}
#test
layer {
name: "conv1_2_bn"
type: "BatchNorm"
bottom: "conv1_2"
top: "conv1_2"
batch_norm_param {
use_global_stats: true
}
}
4,输出一大片固定成了0.5:可能是在最后一层之前用了一次relu,例如最后两层分别是conv层和softmax层,结果在conv层后面加了一个relu,然后就有很多直接数据就被过滤了。
喜欢本文请打赏,一毛两毛也是个意思,么么哒
支F宝账号:2363891614@qq.com