<p dir="auto">My machine has a Titan X card so I would like to use the memory as efficient as possible to avoid expensive data transfer between the CPU and GPU. Therefore, I want to have as many images as possible (let's say 5 GB) on the GPU memory inside a <code class="notranslate">tf.Variable</code> or <code class="notranslate">tf.constant</code>. However, I also want to update these data tensors after a number of iterations (<em>e.g.</em> a replay memory). For training, I then only need to send sample indices to the GPU and use <code class="notranslate">tf.slice</code> to generate a training batch.</p>
<p dir="auto">My question is what the correct way is to update specific elements in an existing <code class="notranslate">tf.Variable</code>? I already found methods using <code class="notranslate">tf.scatter_update</code> and <code class="notranslate">tf.slice</code>:</p>
<p dir="auto"><a href="http://stackoverflow.com/questions/34685947/adjust-single-value-within-tensor-tensorflow" rel="nofollow">http://stackoverflow.com/questions/34685947/adjust-single-value-within-tensor-tensorflow</a><br>
<a href="http://stackoverflow.com/questions/37593960/set-k-largest-elements-of-a-tensor-to-zero-in-tensorflow" rel="nofollow">http://stackoverflow.com/questions/37593960/set-k-largest-elements-of-a-tensor-to-zero-in-tensorflow</a></p>
<p dir="auto">But these methods seem cumbersome and tricky. Are there better ways of updating existing variables?</p>
<p dir="auto">I've been trying to install tensorflow with GPU support using these steps:<br>
<a href="http://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-installation.html" rel="nofollow">http://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-installation.html</a></p>
<p dir="auto">This is the error message that I'm getting when I try to run the bazel build command for building the tensorflow pip package (with the --config-cuda flag set):</p>
<p dir="auto"><code class="notranslate">bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package</code></p>
<p dir="auto">i get :<br>
<code class="notranslate">The specified --crosstool_top '//third_party/gpus/crosstool:crosstool' is not a valid cc_toolchain_suite rule</code></p>
<p dir="auto">What's strange is that if i remove the --config=cuda flag, I don't get the error message while building and I'm able to install tensorflow successfully - but without GPU support.</p>