Created
June 20, 2020 02:43
-
-
Save carlfm01/f1d64d6b262a40e96ed17b910ed28ec8 to your computer and use it in GitHub Desktop.
param count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total_parameters = 0 | |
for variable in tf.trainable_variables(): | |
# shape is an array of tf.Dimension | |
shape = variable.get_shape() | |
print(shape) | |
variable_parameters = 1 | |
for dim in shape: | |
variable_parameters *= dim.value | |
total_parameters += variable_parameters | |
print(f'TOTAL: {total_parameters}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment