Use count_params function for non_trainable_count.
@@ -175,8 +175,7 @@ def print_summary(model, line_length=None, positions=None, print_fn=None):
else:
trainable_count = count_params(model.trainable_weights)
- non_trainable_count = int(
- np.sum([K.count_params(p) for p in set(model.non_trainable_weights)]))
+ non_trainable_count = count_params(model.non_trainable_weights)
print_fn(
'Total params: {:,}'.format(trainable_count + non_trainable_count))
