參數(shù)數(shù)量:
np.sum([np.prod(v.get_shape().as_list()) for v in tf.trainable_variables()])
浮點(diǎn)運(yùn)算量:
tf.contrib.tfprof.model_analyzer.print_model_analysis(tf.get_default_graph(), tfprof_options=tf.contrib.tfprof.model_analyzer.FLOAT_OPS_OPTIONS)