这是关于如何在训练之前将现有权重添加到模型的问题here的扩展。更改caffe中的最后一层
我想使用现有的权重,但我的最终图层输出50而不是1000(因为网络被训练为分类1000项)。从前一篇文章中,通过更改输出图层的名称,我可以添加权重。但后来我意识到还有其他层依赖于最后一层。下面是从VGG网络的一个片段:
layer {
name: "loss3/classifier"
type: "InnerProduct"
bottom: "pool5/7x7_s1"
top: "loss3/classifier"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
inner_product_param {
num_output: 50
weight_filler {
type: "xavier"
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "loss3/loss3"
type: "SoftmaxWithLoss"
bottom: "loss3/classifier"
bottom: "label"
top: "loss3/loss3"
loss_weight: 1
}
layer {
name: "loss3/top-1"
type: "Accuracy"
bottom: "loss3/classifier"
bottom: "label"
top: "loss3/top-1"
include {
phase: TEST
}
}
layer {
name: "loss3/top-5"
type: "Accuracy"
bottom: "loss3/classifier"
bottom: "label"
top: "loss3/top-5"
include {
phase: TEST
}
accuracy_param {
top_k: 5
}
}
我的问题是:
究竟什么是底部和顶部的论点?
我是否需要在后续两层中更改“loss3/classifier”的名称?
啊是的。你是对的。这是googlenet。我对这样的基本问题表示歉意。我一定会浏览教程。谢谢! – MoneyBall