From the C++ point of view, each layer has a blobs() method which returns vector of all Blobs that this layer can learn. You can then call Blob::count() on each of those to find the number of elements it contains.
Within the Python interface, let's assume you start with something like this:
n = caffe.Net('model.prototxt', caffe.TEST)
Then you can find all parameters in
n.params
which is an OrderedDict containing lists of parameter blobs for each layer. So under
n.params[key]
you will get the list of params (e.g. conv filters and biases), each stored as a Blob object. To get convenient access to the contents in form of a numpy array, do
n.params[key][index].data
From there the following gives you shape of the 1st blob of layer conv1:
n.params['conv1'][0].data.shape
and this counts how many weights are in there
n.params['conv1'][0].data.size
HTH!