title: how to calculate a Mobilenet FLOPs in Keras
body: <p></p>
  
  <pre class="lang-python prettyprint-override"><code>run_meta = tf.RunMetadata()
  enter codwith tf.Session(graph=tf.Graph()) as sess:
  K.set_session(sess)
  
  
  with tf.device('/cpu:0'):
      base_model = MobileNet(alpha=1, weights=None, input_tensor=tf.placeholder('float32', shape=(1,224,224,3)))
  
  
  
  
  opts = tf.profiler.ProfileOptionBuilder.float_operation()    
  flops = tf.profiler.profile(sess.graph, run_meta=run_meta, cmd='op', options=opts)
  
  opts = tf.profiler.ProfileOptionBuilder.trainable_variables_parameter()    
  params = tf.profiler.profile(sess.graph, run_meta=run_meta, cmd='op', options=opts)
  
  print("{:,} --- {:,}".format(flops.total_float_ops, params.total_parameters))
  </code></pre>
  
  <p>When I run above code, I got a below result</p>
  
  <pre class="lang-python prettyprint-override"><code>1,137,481,704 --- 4,253,864
  </code></pre>
  
  <p>This is different from the flops described in the paper. </p>
  
  <p>mobilenet: <a href="https://arxiv.org/pdf/1704.04861.pdf" rel="noreferrer">https://arxiv.org/pdf/1704.04861.pdf</a></p>
  
  <p>ShuffleNet: <a href="https://arxiv.org/pdf/1707.01083.pdf" rel="noreferrer">https://arxiv.org/pdf/1707.01083.pdf</a></p>
  
  <p>How to calculate exact flops described in the paper?</p>