title: How many parameters does GoogleNet have?
body: <p>I wrote a simple script to calculate number of parameters a given architecture has. here it is : </p>
  
  <pre><code>#python caffe_param_calc.py deploy.prototxt
  #or just call the script without any arguments, and it will search and show any deploy you have in the current directory
  
  import sys
  import os
  import caffe
  import numpy as np
  from numpy import prod, sum
  from pprint import pprint
  
  def print_net_parameters (deploy_file):
      print "Net: " + deploy_file
      caffe.set_mode_cpu()
      net = caffe.Net(deploy_file, caffe.TEST)
  
      print "Layer-wise parameters: "
      pprint([(k, v[0].data.shape) for k, v in net.params.items()])
      num = sum( [prod(v[0].data.shape) for k, v in net.params.items()] )
      print ("Total number of parameters: {0:,} ".format(num))
  
  print (len(sys.argv))
  if len(sys.argv) &gt; 1 :
      deploy_file = sys.argv[1]
  else:
      for file in os.listdir('.'):
          if (file.endswith('.prototxt')):
             deploy_file = file
  
  print_net_parameters(deploy_file)
  </code></pre>
  
  <p>I used this on GoogleNet and got <code>11,193,984</code> for the number of parameters used, while in their paper, if you add up all the parameters they list in table 1, the total number of parameters become 6.7M! and it seems that table is not accurate either!. My question now is, Am I doing this correctly? I used the same script on different architectures and got the correct result.<br>
  For example VGGNet (<a href="https://gist.github.com/ksimonyan/fd8800eeb36e276cd6f9#file-readme-md" rel="nofollow noreferrer">Link</a>) has a total number of parameters of 102,897,440.</p>
  
  <pre><code>Layer-wise parameters:
  [('conv1', (96L, 3L, 7L, 7L)),
   ('conv2', (256L, 96L, 5L, 5L)),
   ('conv3', (512L, 256L, 3L, 3L)),
   ('conv4', (512L, 512L, 3L, 3L)),
   ('conv5', (512L, 512L, 3L, 3L)),
   ('fc6', (4096L, 18432L)),
   ('fc7', (4096L, 4096L)),
   ('fc8', (1000L, 4096L))]
  Total number of parameters: 102,897,440
  </code></pre>