Skip to content

Instantly share code, notes, and snippets.

@kaushikpavani
kaushikpavani / compute_caffe_parameters.py
Created September 25, 2016 14:14
Calculate number of parameters in a Caffe model
import caffe
caffe.set_mode_cpu()
import numpy as np
from numpy import prod, sum
from pprint import pprint
def print_net_parameters (deploy_file):
print "Net: " + deploy_file
net = caffe.Net(deploy_file, caffe.TEST)
print "Layer-wise parameters: "