de class="python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow.keras.backend <span class="hljs-keyword">as</span> K
<span class="hljs-meta">&gt;&gt;&gt; </span>np.sum([K.count_params(p) <span class="hljs-keyword">for</span> p <span class="hljs-keyword">in</span> model.trainable_weights])
<span class="hljs-number">22855952</