<p dir="auto">I need to limit CPU usage of tensorflow on Windows by setting inter_op_parallelism_threads = 1 , ( intra_op_parallelism_threads = 1  also for CPU)</p>
<p dir="auto">When I run a model on CPU, inter_op_parallelism_threads = 1  works perfectly, and only one logical core is used.</p>
<p dir="auto">But when I run a model on GPU,  inter_op_parallelism_threads =1 doesn't work,  tensorflow still uses all the available logical cores.</p>
<p dir="auto">We are using:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="with sv.managed_session(
  server.target,
  config=tf.ConfigProto(log_device_placement=True,
                        inter_op_parallelism_threads=1,
                        intra_op_parallelism_threads=1),
) as sess:"><pre lang=".python" class="notranslate"><code class="notranslate">with sv.managed_session(
  server.target,
  config=tf.ConfigProto(log_device_placement=True,
                        inter_op_parallelism_threads=1,
                        intra_op_parallelism_threads=1),
) as sess:
</code></pre></div>
<p dir="auto">but TensorFlow still launches a number of threads proportional to the number of cores on each process. I counted +50 threads used by each process on my 24 vcore machine.</p>
<p dir="auto">What can we do to limit the number of threads in a managed session.</p>
<p dir="auto">EDIT: <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> identified the problem. See the end of the thread about Session vs Server options.</p>