How do I load a caffe model and convert to a numpy array?

Here’s a nice function that converts a caffe net to a python list of dictionaries, so you can pickle it and read it anyway you want: import caffe def shai_net_to_py_readable(prototxt_filename, caffemodel_filename): net = caffe.Net(prototxt_filename, caffemodel_filename, caffe.TEST) # read the net + weights pynet_ = [] for li in xrange(len(net.layers)): # for each layer in the … Read more

What is `weight_decay` meta parameter in Caffe?

The weight_decay meta parameter govern the regularization term of the neural net. During training a regularization term is added to the network’s loss to compute the backprop gradient. The weight_decay value determines how dominant this regularization term will be in the gradient computation. As a rule of thumb, the more training examples you have, the … Read more

Caffe | solver.prototxt values setting strategy

In order to set these values in a meaningful manner, you need to have a few more bits of information regarding your data: 1. Training set size the total number of training examples you have, let’s call this quantity T. 2. Training batch size the number of training examples processed together in a single batch, … Read more

How to interpret caffe log with debug_info?

At first glance you can see this log section divided into two: [Forward] and [Backward]. Recall that neural network training is done via forward-backward propagation: A training example (batch) is fed to the net and a forward pass outputs the current prediction. Based on this prediction a loss is computed. The loss is then derived, … Read more