<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>: Yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Ubuntu 16.04</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: Binary, tf-nightly</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.7.0.dev20180214, git version <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/b2a0f1c45b2283910548ebd88ee5aaf4b6fc6077/hovercard" href="https://github.com/tensorflow/tensorflow/commit/b2a0f1c45b2283910548ebd88ee5aaf4b6fc6077"><tt>b2a0f1c</tt></a></li>
<li><strong>Python version</strong>: 2.7.12</li>
<li><strong>Bazel version (if compiling from source)</strong>: N/A</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: N/A</li>
<li><strong>CUDA/cuDNN version</strong>: N/A</li>
<li><strong>GPU model and memory</strong>: N/A</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf
from tensorflow.contrib.image.ops import gen_distort_image_ops
from tensorflow.python.framework import tensor_util
tensor_util.constant_value(tf.convert_to_tensor([1., 1.]))"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span>
<span class="pl-k">from</span> <span class="pl-s1">tensorflow</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">image</span>.<span class="pl-s1">ops</span> <span class="pl-k">import</span> <span class="pl-s1">gen_distort_image_ops</span>
<span class="pl-k">from</span> <span class="pl-s1">tensorflow</span>.<span class="pl-s1">python</span>.<span class="pl-s1">framework</span> <span class="pl-k">import</span> <span class="pl-s1">tensor_util</span>
<span class="pl-s1">tensor_util</span>.<span class="pl-en">constant_value</span>(<span class="pl-s1">tf</span>.<span class="pl-en">convert_to_tensor</span>([<span class="pl-c1">1.</span>, <span class="pl-c1">1.</span>]))</pre></div>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">When I run the program above, I get the warning</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/reedwm/venvs/tfnightlycpu/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py:560: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
  return np.fromstring(tensor.tensor_content, dtype=dtype).reshape(shape)"><pre class="notranslate"><code class="notranslate">/home/reedwm/venvs/tfnightlycpu/local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py:560: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
  return np.fromstring(tensor.tensor_content, dtype=dtype).reshape(shape)
</code></pre></div>
<p dir="auto">This may not seem so bad, but when running <a href="https://github.com/tensorflow/benchmarks/tree/master/scripts/tf_cnn_benchmarks"><code class="notranslate">tf_cnn_benchmarks</code></a>, I get hundreds of such warnings.</p>
<p dir="auto">What's very strange is that if I comment the line <code class="notranslate">from tensorflow.contrib.image.ops import gen_distort_image_ops</code>, I don't get the warning.</p>
<p dir="auto">This is the same issue as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="295689808" data-permission-text="Title is private" data-url="https://github.com/tensorpack/tensorpack/issues/641" data-hovercard-type="issue" data-hovercard-url="/tensorpack/tensorpack/issues/641/hovercard" href="https://github.com/tensorpack/tensorpack/issues/641">tensorpack/tensorpack#641</a>. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/yaroslavvb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yaroslavvb">@yaroslavvb</a>, did you file a TensorFlow bug for this? If so, this can be marked as a duplicate.</p>
<p dir="auto">Not really sure who to triage this to. /CC <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mrry/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mrry">@mrry</a>, can you address this or retriage?</p>
<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow):</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04):</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary):</li>
<li>TensorFlow version (use command below):</li>
<li>Python version:</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version:</li>
<li>GPU model and memory:</li>
</ul>
<p dir="auto">You can collect some of this information using our environment capture<br>
<a href="https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh">script</a><br>
You can also obtain the TensorFlow version with: 1. TF 1.0: <code class="notranslate">python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"</code> 2. TF 2.0: <code class="notranslate">python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"</code></p>
<p dir="auto"><strong>Describe the current behavior</strong></p>
<p dir="auto"><strong>Describe the expected behavior</strong></p>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
Provide a reproducible test case that is the bare minimum necessary to generate the problem.</p>
<p dir="auto"><strong>Other info / logs</strong><br>
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.</p>