<p dir="auto">Please go to Stack Overflow for help and support:</p>
<p dir="auto"><a href="http://stackoverflow.com/questions/tagged/tensorflow" rel="nofollow">http://stackoverflow.com/questions/tagged/tensorflow</a></p>
<p dir="auto">If you open a GitHub issue, here is our policy:</p>
<ol dir="auto">
<li>It must be a bug or a feature request.</li>
<li>The form below must be filled out.</li>
</ol>
<p dir="auto"><strong>Here's why we have that policy</strong>: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.</p>
<hr>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:<br>
yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>:<br>
Ubuntu 14.04</li>
<li><strong>TensorFlow installed from (source or binary)</strong>:<br>
source</li>
<li><strong>TensorFlow version (use command below)</strong>:<br>
1.2.0-rc0</li>
<li><strong>Bazel version (if compiling from source)</strong>:</li>
<li><strong>CUDA/cuDNN version</strong>:<br>
8.0</li>
<li><strong>GPU model and memory</strong>:</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<p dir="auto">cod (mostly from <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/input_fn/boston.py">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/input_fn/boston.py</a>)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from tensorflow.contrib.learn.python.learn.learn_io import pandas_io
import pandas as pd
import tensorflow as tf
import pdb

tf.logging.set_verbosity(tf.logging.INFO)

COLUMNS = [&quot;crim&quot;, &quot;zn&quot;, &quot;indus&quot;, &quot;nox&quot;, &quot;rm&quot;, &quot;age&quot;,
           &quot;dis&quot;, &quot;tax&quot;, &quot;ptratio&quot;, &quot;medv&quot;]
FEATURES = [&quot;crim&quot;, &quot;zn&quot;, &quot;indus&quot;, &quot;nox&quot;, &quot;rm&quot;,
            &quot;age&quot;, &quot;dis&quot;, &quot;tax&quot;, &quot;ptratio&quot;]
LABEL = &quot;medv&quot;

training_set = pd.read_csv(&quot;boston_train.csv&quot;, skipinitialspace=True,
                           skiprows=1, names=COLUMNS)
# test_set = pd.read_csv(&quot;boston_test.csv&quot;, skipinitialspace=True,
#                        skiprows=1, names=COLUMNS)
# prediction_set = pd.read_csv(&quot;boston_predict.csv&quot;, skipinitialspace=True,
#                              skiprows=1, names=COLUMNS)

feature_cols = [tf.contrib.layers.real_valued_column(k) for k in FEATURES]

regressor = tf.contrib.learn.DNNRegressor(feature_columns=feature_cols,
                                          hidden_units=[10, 10],
                                          model_dir=&quot;/tmp/boston_model&quot;)

pd_input_fn = pandas_io.pandas_input_fn(training_set[FEATURES], y=training_set[LABEL],
                                        batch_size=128,target_column='medv')

regressor.fit(input_fn=pd_input_fn, steps=5000)"><pre class="notranslate"><code class="notranslate">from tensorflow.contrib.learn.python.learn.learn_io import pandas_io
import pandas as pd
import tensorflow as tf
import pdb

tf.logging.set_verbosity(tf.logging.INFO)

COLUMNS = ["crim", "zn", "indus", "nox", "rm", "age",
           "dis", "tax", "ptratio", "medv"]
FEATURES = ["crim", "zn", "indus", "nox", "rm",
            "age", "dis", "tax", "ptratio"]
LABEL = "medv"

training_set = pd.read_csv("boston_train.csv", skipinitialspace=True,
                           skiprows=1, names=COLUMNS)
# test_set = pd.read_csv("boston_test.csv", skipinitialspace=True,
#                        skiprows=1, names=COLUMNS)
# prediction_set = pd.read_csv("boston_predict.csv", skipinitialspace=True,
#                              skiprows=1, names=COLUMNS)

feature_cols = [tf.contrib.layers.real_valued_column(k) for k in FEATURES]

regressor = tf.contrib.learn.DNNRegressor(feature_columns=feature_cols,
                                          hidden_units=[10, 10],
                                          model_dir="/tmp/boston_model")

pd_input_fn = pandas_io.pandas_input_fn(training_set[FEATURES], y=training_set[LABEL],
                                        batch_size=128,target_column='medv')

regressor.fit(input_fn=pd_input_fn, steps=5000)
</code></pre></div>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.</p>
<p dir="auto">I saw a stakoervlow question <a href="https://stackoverflow.com/questions/41273182/tensorflow-0-12-tutorials-produce-warning-rank-of-input-tensor-should-be-the-s" rel="nofollow">here</a>, but I don't think that applies to me.</p>
<p dir="auto">I have the following confusing warnings.  As a result, I am not sure that everything is right.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WA"><pre class="notranslate"><code class="notranslate">WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WA
</code></pre></div>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">Full output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="INFO:tensorflow:Using default config.
INFO:tensorflow:Using config: {'_task_type': None, '_task_id': 0, '_cluster_spec': &lt;tensorflow.python.training.server_lib.ClusterSpec object at 0x7f5a3710eba8&gt;, '_master': '', '_num_ps_replicas': 0, '_num_worker_replicas': 0, '_environment': 'local', '_is_chief': True, '_evaluation_master': '', '_tf_config': gpu_options {
  per_process_gpu_memory_fraction: 1.0
}
, '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_secs': 600, '_session_config': None, '_save_checkpoints_steps': None, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_model_dir': '/tmp/boston_model'}
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:From /home/jiqiang/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/head.py:625: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported.
INFO:tensorflow:Create CheckpointSaverHook.
INFO:tensorflow:Restoring parameters from /tmp/boston_model/model.ckpt-16
INFO:tensorflow:Saving checkpoints for 17 into /tmp/boston_model/model.ckpt.
INFO:tensorflow:loss = 115.183, step = 17
INFO:tensorflow:Saving checkpoints for 20 into /tmp/boston_model/model.ckpt.
INFO:tensorflow:Loss for final step: 161.23.
"><pre class="notranslate"><code class="notranslate">INFO:tensorflow:Using default config.
INFO:tensorflow:Using config: {'_task_type': None, '_task_id': 0, '_cluster_spec': &lt;tensorflow.python.training.server_lib.ClusterSpec object at 0x7f5a3710eba8&gt;, '_master': '', '_num_ps_replicas': 0, '_num_worker_replicas': 0, '_environment': 'local', '_is_chief': True, '_evaluation_master': '', '_tf_config': gpu_options {
  per_process_gpu_memory_fraction: 1.0
}
, '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_secs': 600, '_session_config': None, '_save_checkpoints_steps': None, '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_model_dir': '/tmp/boston_model'}
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:Rank of input Tensor (1) should be the same as output_rank (2) for column. Will attempt to expand dims. It is highly recommended that you resize your input, as this behavior may change.
WARNING:tensorflow:From /home/jiqiang/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/estimators/head.py:625: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.
Instructions for updating:
Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported.
INFO:tensorflow:Create CheckpointSaverHook.
INFO:tensorflow:Restoring parameters from /tmp/boston_model/model.ckpt-16
INFO:tensorflow:Saving checkpoints for 17 into /tmp/boston_model/model.ckpt.
INFO:tensorflow:loss = 115.183, step = 17
INFO:tensorflow:Saving checkpoints for 20 into /tmp/boston_model/model.ckpt.
INFO:tensorflow:Loss for final step: 161.23.

</code></pre></div>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Google Colab</li>
<li><strong>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device</strong>:</li>
<li><strong>TensorFlow installed from (source or binary)</strong>:</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.9.0</li>
<li><strong>Python version</strong>: 3.6</li>
<li><strong>Bazel version (if compiling from source)</strong>:</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>:</li>
<li><strong>CUDA/cuDNN version</strong>:</li>
<li><strong>GPU model and memory</strong>: Colab GPUs</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">To make it short, Keras's Tensorboard callback doesn't work in the eager execution mode.</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">RuntimeErrorTraceback (most recent call last)<br>
 in ()<br>
57 X = np.random.random((20, 10)).astype(np.float32)<br>
58 Y = np.random.random((20, 5)).astype(np.float32)<br>
---&gt; 59 model.fit(x={'input' : X}, y={'clustering' : Y}, batch_size=1, epochs=10, callbacks=[tensorboard])</p>
<p dir="auto">/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/engine/training.pyc in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)<br>
1331           initial_epoch=initial_epoch,<br>
1332           steps_per_epoch=steps_per_epoch,<br>
-&gt; 1333           validation_steps=validation_steps)<br>
1334     else:<br>
1335       return training_arrays.fit_loop(</p>
<p dir="auto">/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/engine/training_eager.pyc in fit_loop(model, inputs, targets, sample_weights, class_weight, val_inputs, val_targets, val_sample_weights, batch_size, epochs, verbose, callbacks, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)<br>
977       callback_model = model<br>
978<br>
--&gt; 979     callbacks.set_model(callback_model)<br>
980<br>
981     callbacks.set_params({</p>
<p dir="auto">/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/callbacks.pyc in set_model(self, model)<br>
68   def set_model(self, model):<br>
69     for callback in self.callbacks:<br>
---&gt; 70       callback.set_model(model)<br>
71<br>
72   def on_epoch_begin(self, epoch, logs=None):</p>
<p dir="auto">/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/callbacks.pyc in set_model(self, model)<br>
761         if hasattr(layer, 'output'):<br>
762           tf_summary.histogram('{}_out'.format(layer.name), layer.output)<br>
--&gt; 763     self.merged = tf_summary.merge_all()<br>
764<br>
765     if self.write_graph:</p>
<p dir="auto">/usr/local/lib/python2.7/dist-packages/tensorflow/python/summary/summary.pyc in merge_all(key, scope)<br>
309   if _context.executing_eagerly():<br>
310     raise RuntimeError(<br>
--&gt; 311         'Merging tf.summary.* ops is not compatible with eager execution. '<br>
312         'Use tf.contrib.summary instead.')<br>
313   summary_ops = _ops.get_collection(key, scope=scope)</p>
<p dir="auto">RuntimeError: Merging tf.summary.* ops is not compatible with eager execution. Use tf.contrib.summary instead.</p>