<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution: Linux 18.04</li>
<li>TensorFlow version 2.0-alpha</li>
<li>Python 3.6.8</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong></p>
<p dir="auto">Trying to write any tensor as histogram summary:</p>
<blockquote>
<p dir="auto">/tmp/cpu-env/lib/python3.6/site-packages/tensorboard/plugins/histogram/summary_v2.py in _buckets(data, bucket_count)<br>
89   if bucket_count is None:<br>
90     bucket_count = DEFAULT_BUCKET_COUNT<br>
---&gt; 91   with tf.name_scope('buckets', values=[data, bucket_count]):<br>
92     tf.debugging.assert_scalar(bucket_count)<br>
93     tf.debugging.assert_type(bucket_count, tf.int32)<br>
TypeError: <strong>init</strong>() got an unexpected keyword argument 'values'</p>
</blockquote>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
<code class="notranslate">tf.summary.histogram('SampleKernel', tf.random.normal(shape=[3,3,3,32], dtype=tf.float32))</code></p>
<ul dir="auto">
<li>TensorBoard version (from pip package, also printed out when running <code class="notranslate">tensorboard</code>)<br>
-- TensorBoard 1.14.0a20190301</li>
<li>TensorFlow version if different from TensorBoard<br>
-- TensorFlow-gpu 2.0-alpha</li>
<li>OS Platform and version (e.g., Linux Ubuntu 16.04)<br>
-- Linux, Arch, Kernel 4.19</li>
<li>Python version (e.g. 2.7, 3.5)<br>
-- Python 3.6.7</li>
</ul>
<p dir="auto">I have built a GAN with TF 2.0-alpha using <code class="notranslate">tf.keras</code>. I am using TensorBoard via <code class="notranslate">train_writer = tf.summary.create_file_writer("log-train")</code>. Adding scalars with <code class="notranslate">tf.summary.scalar("loss g", loss_g, step=batch_id)</code> and storing predicted images with <code class="notranslate">tf.summary.image("g pred", prediction[0:3], step=batch_id)</code> works without any problems.</p>
<p dir="auto">However, when I try to add the generator's weights to TensorBoard with <code class="notranslate">tf.summary.histogram</code> it fails.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="for layer in G_model.layers:
    for weight in layer.weights:
        tf.summary.histogram(weight.name, weight, step=batch_id)"><pre class="notranslate"><code class="notranslate">for layer in G_model.layers:
    for weight in layer.weights:
        tf.summary.histogram(weight.name, weight, step=batch_id)
</code></pre></div>
<p dir="auto"><code class="notranslate">G_model</code> is a <code class="notranslate">tf.keras</code> model created with the functional API.</p>
<p dir="auto">The exception seems to be TensorBoard-specific:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;train.py&quot;, line 84, in &lt;module&gt;
    tf.summary.histogram(weight.name, weight, step=batch_id)
  File &quot;(...)/python3.6/site-packages/tensorboard/plugins/histogram/summary_v2.py&quot;, line 73, in histogram
    tensor = _buckets(data, bucket_count=buckets)
  File &quot;(...)/python3.6/site-packages/tensorboard/plugins/histogram/summary_v2.py&quot;, line 91, in _buckets
    with tf.name_scope('buckets', values=[data, bucket_count]):
TypeError: __init__() got an unexpected keyword argument 'values'"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "train.py", line 84, in &lt;module&gt;
    tf.summary.histogram(weight.name, weight, step=batch_id)
  File "(...)/python3.6/site-packages/tensorboard/plugins/histogram/summary_v2.py", line 73, in histogram
    tensor = _buckets(data, bucket_count=buckets)
  File "(...)/python3.6/site-packages/tensorboard/plugins/histogram/summary_v2.py", line 91, in _buckets
    with tf.name_scope('buckets', values=[data, bucket_count]):
TypeError: __init__() got an unexpected keyword argument 'values'
</code></pre></div>
<p dir="auto">If I simply <strong>delete</strong> <code class="notranslate">, values=[data, bucket_count]</code> in <code class="notranslate">summary_v2.py</code> (line 91) it works, <strong>weights are showing up correctly in TensorBoard then</strong>.</p>
<p dir="auto">Thus, original code of <code class="notranslate">summary_v2.py</code> in line 91:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="with tf.name_scope('buckets', values=[data, bucket_count]):"><pre class="notranslate"><code class="notranslate">with tf.name_scope('buckets', values=[data, bucket_count]):
</code></pre></div>
<p dir="auto">throws the exception posted above, while this code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="with tf.name_scope('buckets'):"><pre class="notranslate"><code class="notranslate">with tf.name_scope('buckets'):
</code></pre></div>
<p dir="auto">is working properly.</p>