Splitting Caffe Models

278 views
Skip to first unread message

Daniel

unread,
Jun 22, 2016, 6:12:24 AM6/22/16
to Caffe Users
Hi,

is it possible to split a caffe model at any point for deployment? For example training the whole AlexNet and then only using the fully-connected part with the trained weights?

For example, could I change the deploy.prototxt of AlexNet to this...

name: "AlexNet"
layer
{ # Input is the extracted fc6 layer data
    name
: "data"
    type
: "Input"
    top
: "data"
    input_param
{
        shape
: { dim: 1 dim: 1 dim: 4096 dim: 1 } # fc6 layer blob shape
   
}
}
layer {
    name
: "fc7"
    type
: "InnerProduct"
    bottom
: "data"
    top
: "fc7"
    param
{ lr_mult: 1 decay_mult: 1 }
    param
{ lr_mult: 2 decay_mult: 0 }
    inner_product_param
{ num_output: 4096 }
}
#...the rest like in deploy.prototxt
layer {
    name
: "prob"
    type
: "Softmax"
    bottom
: "fc8"
    top
: "prob"
}


...and still get valid results when the fc6 layer data is extracted and used as input blob?

Thanks a lot!

Jonghoon Jin

unread,
Jun 22, 2016, 1:01:21 PM6/22/16
to Caffe Users
Yes, as long as the layer has the same name as in training phase.

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/07a7bfd0-7331-46fc-9917-c3a78f869883%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages