提交 d476ecc7 编写于 作者: J jnphilipp 提交者: François Chollet

Use count_params function for non_trainable_count. (#10280)

上级 a07d9f3f
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册