how to extracting weights and biases from .caffemodel files

891 views
Skip to first unread message

went...@gmail.com

unread,
Oct 11, 2016, 12:50:46 PM10/11/16
to Caffe Users
Hello guys,

Now I have a trained .caffemodel file, and I wrote a simple c++ program to read the names and layer types of the net according to caffe.proto:

void Listlayers(const caffe::NetParameter& net) {
    for (int i=0; i < net.layer_size(); i++) {
        const caffe::LayerParameter& layer = net.layer(i);
        cout << "Layer Name: " << layer.name()<< endl;
        cout << "Layer Tpye: " << layer.type()<< endl;
    }
}

However, I can't locate where the weights and biases are stored according to the caffe.proto file. Can anyone help me with this?

Thanks!

went...@gmail.com

unread,
Oct 14, 2016, 11:39:36 AM10/14/16
to Caffe Users
anyone?

Przemek D

unread,
Oct 25, 2016, 7:48:35 AM10/25/16
to Caffe Users
The easiest route is through python - check the example
For C++ you'll probably waste lots of time reading caffe code, as there's no tutorial for it.
Reply all
Reply to author
Forward
0 new messages