<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>:</li>
</ul>
<p dir="auto">I've adapted the ZeroOut operator from the <a href="https://www.tensorflow.org/extend/adding_an_op" rel="nofollow">Adding a New Op</a> example.</p>
<ul dir="auto">
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>:</li>
</ul>
<p dir="auto">Linux Ubuntu 16.04</p>
<ul dir="auto">
<li><strong>TensorFlow installed from (source or binary)</strong>:</li>
</ul>
<p dir="auto">binary GPU 1.3.0</p>
<ul dir="auto">
<li><strong>TensorFlow version (use command below)</strong>:</li>
</ul>
<p dir="auto">$ python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"<br>
('v1.3.0-rc2-20-g0787eee', '1.3.0')</p>
<ul dir="auto">
<li><strong>Python version</strong>:</li>
</ul>
<p dir="auto">2.7.12</p>
<ul dir="auto">
<li><strong>Bazel version (if compiling from source)</strong>:</li>
</ul>
<p dir="auto">N/A</p>
<ul dir="auto">
<li><strong>CUDA/cuDNN version</strong>:</li>
</ul>
<p dir="auto">N/A</p>
<ul dir="auto">
<li><strong>GPU model and memory</strong>:</li>
</ul>
<p dir="auto">N/A</p>
<ul dir="auto">
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<p dir="auto">Test operator: <a href="https://github.com/tensorflow/tensorflow/files/1332745/shard_fails.zip">shard_fails.zip</a></p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ make
$ python test_op.py"><pre class="notranslate">$ make
$ python test_op.py</pre></div>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">When the above C++ operator runs, it'll print the number of threads in the pool (8) and then segfault on the Shard call.</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">C++ operator code:</p>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#define EIGEN_USE_THREADS

#include &quot;tensorflow/core/lib/core/threadpool.h&quot;
#include &quot;tensorflow/core/framework/op.h&quot;
#include &quot;tensorflow/core/framework/op_kernel.h&quot;
#include &quot;tensorflow/core/framework/shape_inference.h&quot;
#include &quot;tensorflow/core/util/work_sharder.h&quot;

using namespace tensorflow;

REGISTER_OP(&quot;ZeroOut&quot;)
    .Input(&quot;to_zero: int32&quot;)
    .Output(&quot;zeroed: int32&quot;)
    .SetShapeFn([](::tensorflow::shape_inference::InferenceContext* c) {
      c-&gt;set_output(0, c-&gt;input(0));
      return Status::OK();
    });

class ZeroOutOp : public OpKernel {
 public:
  explicit ZeroOutOp(OpKernelConstruction* context) : OpKernel(context) {}

  void Compute(OpKernelContext* context) override {
    // Grab the input tensor
    const Tensor&amp; input_tensor = context-&gt;input(0);
    auto input = input_tensor.flat&lt;int32&gt;();

    // Create an output tensor
    Tensor* output_tensor = NULL;
    OP_REQUIRES_OK(context, context-&gt;allocate_output(0, input_tensor.shape(),
                                                     &amp;output_tensor));
    auto output_flat = output_tensor-&gt;flat&lt;int32&gt;();

    // Set all but the first element of the output tensor to 0.
    const int N = input.size();

    auto pool = context-&gt;device()-&gt;tensorflow_cpu_worker_threads()-&gt;workers;
    printf(&quot;Pool Threads %d\n&quot;, pool-&gt;NumThreads());
    Shard(pool-&gt;NumThreads(), pool, N, 10, [&amp;](int64 start, int64 end) {
        for(int64 i=start; i&lt;end; ++i)
            { output_flat(i) = 0; }
    });

    if(N &gt; 0)
        { output_flat(0) = input(0); }
  }
};

REGISTER_KERNEL_BUILDER(Name(&quot;ZeroOut&quot;).Device(DEVICE_CPU), ZeroOutOp);"><pre class="notranslate">#<span class="pl-k">define</span> <span class="pl-en">EIGEN_USE_THREADS</span>

#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>tensorflow/core/lib/core/threadpool.h<span class="pl-pds">"</span></span>
#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>tensorflow/core/framework/op.h<span class="pl-pds">"</span></span>
#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>tensorflow/core/framework/op_kernel.h<span class="pl-pds">"</span></span>
#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>tensorflow/core/framework/shape_inference.h<span class="pl-pds">"</span></span>
#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">"</span>tensorflow/core/util/work_sharder.h<span class="pl-pds">"</span></span>

<span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-en">tensorflow</span><span class="pl-k">;</span>

<span class="pl-en">REGISTER_OP</span>(<span class="pl-s"><span class="pl-pds">"</span>ZeroOut<span class="pl-pds">"</span></span>)
    .Input(<span class="pl-s"><span class="pl-pds">"</span>to_zero: int32<span class="pl-pds">"</span></span>)
    .Output(<span class="pl-s"><span class="pl-pds">"</span>zeroed: int32<span class="pl-pds">"</span></span>)
    .SetShapeFn([](::tensorflow::shape_inference::InferenceContext* c) {
      c-&gt;<span class="pl-c1">set_output</span>(<span class="pl-c1">0</span>, c-&gt;<span class="pl-c1">input</span>(<span class="pl-c1">0</span>));
      <span class="pl-k">return</span> <span class="pl-c1">Status::OK</span>();
    });

<span class="pl-k">class</span> <span class="pl-en">ZeroOutOp</span> : <span class="pl-k">public</span> <span class="pl-en">OpKernel</span> {
 <span class="pl-k">public:</span>
  <span class="pl-k">explicit</span> <span class="pl-en">ZeroOutOp</span>(OpKernelConstruction* context) : OpKernel(context) {}

  <span class="pl-k">void</span> <span class="pl-en">Compute</span>(OpKernelContext* context) <span class="pl-k">override</span> {
    <span class="pl-c"><span class="pl-c">//</span> Grab the input tensor</span>
    <span class="pl-k">const</span> Tensor&amp; input_tensor = context-&gt;<span class="pl-c1">input</span>(<span class="pl-c1">0</span>);
    <span class="pl-k">auto</span> input = input_tensor.<span class="pl-smi">flat</span>&lt;int32&gt;();

    <span class="pl-c"><span class="pl-c">//</span> Create an output tensor</span>
    Tensor* output_tensor = <span class="pl-c1">NULL</span>;
    <span class="pl-c1">OP_REQUIRES_OK</span>(context, context-&gt;<span class="pl-c1">allocate_output</span>(<span class="pl-c1">0</span>, input_tensor.<span class="pl-c1">shape</span>(),
                                                     &amp;output_tensor));
    <span class="pl-k">auto</span> output_flat = output_tensor-&gt;<span class="pl-smi">flat</span>&lt;int32&gt;();

    <span class="pl-c"><span class="pl-c">//</span> Set all but the first element of the output tensor to 0.</span>
    <span class="pl-k">const</span> <span class="pl-k">int</span> N = input.<span class="pl-c1">size</span>();

    <span class="pl-k">auto</span> pool = context-&gt;<span class="pl-c1">device</span>()-&gt;<span class="pl-c1">tensorflow_cpu_worker_threads</span>()-&gt;<span class="pl-smi">workers</span>;
    <span class="pl-c1">printf</span>(<span class="pl-s"><span class="pl-pds">"</span>Pool Threads %d<span class="pl-cce">\n</span><span class="pl-pds">"</span></span>, pool-&gt;<span class="pl-c1">NumThreads</span>());
    <span class="pl-c1">Shard</span>(pool-&gt;<span class="pl-c1">NumThreads</span>(), pool, N, <span class="pl-c1">10</span>, [&amp;](int64 start, int64 end) {
        <span class="pl-k">for</span>(int64 i=start; i&lt;end; ++i)
            { <span class="pl-c1">output_flat</span>(i) = <span class="pl-c1">0</span>; }
    });

    <span class="pl-k">if</span>(N &gt; <span class="pl-c1">0</span>)
        { <span class="pl-c1">output_flat</span>(<span class="pl-c1">0</span>) = <span class="pl-c1">input</span>(<span class="pl-c1">0</span>); }
  }
};

<span class="pl-en">REGISTER_KERNEL_BUILDER</span>(Name(<span class="pl-s"><span class="pl-pds">"</span>ZeroOut<span class="pl-pds">"</span></span>).Device(DEVICE_CPU), ZeroOutOp);</pre></div>
<p dir="auto">See below the gdb trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Core was generated by `python test_op.py'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  std::_Function_handler&lt;void (long long, long long), ZeroOutOp::Compute(tensorflow::OpKernelContext*)::{lambda(long long, long long)#1}&gt;::_M_invoke(std::_Any_data const&amp;, long long&amp;&amp;, std::_Any_data const&amp;) (__functor=..., __args#0=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c73&gt;, __args#1=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c78&gt;) at /usr/include/c++/5/functional:1871
1871		(*_Base::_M_get_pointer(__functor))(
[Current thread is 1 (Thread 0x7f38a6605700 (LWP 3771))]
(gdb) bt
#0  std::_Function_handler&lt;void (long long, long long), ZeroOutOp::Compute(tensorflow::OpKernelContext*)::{lambda(long long, long long)#1}&gt;::_M_invoke(std::_Any_data const&amp;, long long&amp;&amp;, std::_Any_data const&amp;) (__functor=..., __args#0=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c73&gt;, __args#1=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c78&gt;) at /usr/include/c++/5/functional:1871
#1  0x00007f3879dcc75d in tensorflow::thread::ThreadPool::Impl::ParallelFor(long long, long long, std::function&lt;void (long long, long long)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#2  0x00007f3879dcc93f in tensorflow::thread::ThreadPool::ParallelFor(long long, long long, std::function&lt;void (long long, long long)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#3  0x00007f3879d4d995 in tensorflow::Shard(int, tensorflow::thread::ThreadPool*, long long, long long, std::function&lt;void (long long, long long)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#4  0x00007f3850bfb79e in ZeroOutOp::Compute (this=0x62dacc0, context=0x7ffd1a20fe30) at tf_op.cpp:42
#5  0x00007f3879a2563c in tensorflow::ThreadPoolDevice::Compute(tensorflow::OpKernel*, tensorflow::OpKernelContext*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#6  0x00007f38799f5a58 in tensorflow::(anonymous namespace)::ExecutorState::Process(tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#7  0x00007f38799f61fa in std::_Function_handler&lt;void (), tensorflow::(anonymous namespace)::ExecutorState::ScheduleReady(tensorflow::gtl::InlinedVector&lt;tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, 8&gt; const&amp;, tensorflow::(anonymous namespace)::ExecutorState::TaggedNodeReadyQueue*)::{lambda()#1}&gt;::_M_invoke(std::_Any_data const&amp;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#8  0x00007f3879a035c4 in std::_Function_handler&lt;void (std::function&lt;void ()&gt;), tensorflow::GraphRunner::Run(tensorflow::Graph*, tensorflow::FunctionLibraryRuntime*, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;tensorflow::Tensor, std::allocator&lt;tensorflow::Tensor&gt; &gt;*)::{lambda(std::function&lt;void ()&gt;)#1}&gt;::_M_invoke(std::_Any_data const&amp;, std::function&lt;void ()&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#9  0x00007f38799e895b in std::function&lt;void (std::function&lt;void ()&gt;)&gt;::operator()(std::function&lt;void ()&gt;) const ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#10 0x00007f38799e9043 in tensorflow::(anonymous namespace)::ExecutorState::ScheduleReady(tensorflow::gtl::InlinedVector&lt;tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, 8&gt; const&amp;, tensorflow::(anonymous namespace)::ExecutorState::TaggedNodeReadyQueue*) [clone .part.246] () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#11 0x00007f38799ecf5e in tensorflow::(anonymous namespace)::ExecutorImpl::RunAsync(tensorflow::Executor::Args const&amp;, std::function&lt;void (tensorflow::Status const&amp;)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#12 0x00007f3879a045e4 in tensorflow::GraphRunner::Run(tensorflow::Graph*, tensorflow::FunctionLibraryRuntime*, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;tensorflow::Tensor, std::allocator&lt;tensorflow::Tensor&gt; &gt;*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#13 0x00007f38799dce27 in tensorflow::ConstantFold(tensorflow::ConstantFoldingOptions const&amp;, tensorflow::FunctionLibraryRuntime*, tensorflow::Env*, tensorflow::Device*, tensorflow::Graph*, bool*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#14 0x00007f3879a02fea in tensorflow::GraphOptimizer::Optimize(tensorflow::FunctionLibraryRuntime*, tensorflow::Env*, tensorflow::Device*, std::unique_ptr&lt;tensorflow::Graph, std::default_delete&lt;tensorflow::Graph&gt; &gt;*) () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#15 0x00007f38799a9469 in tensorflow::DirectSession::GetOrCreateExecutors(tensorflow::thread::ThreadPool*, tensorflow::gtl::ArraySlice&lt;std::string&gt;, tensorflow::gtl::ArraySlice&lt;std::string&gt;, tensorflow::gtl::ArraySlice&lt;std::string&gt;, tensorflow::DirectSession::ExecutorsAndKeys**, tensorflow::DirectSession::RunStateArgs*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#16 0x00007f38799aa06c in tensorflow::DirectSession::Run(tensorflow::RunOptions const&amp;, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;tensorflow::Tensor, std::allocator&lt;tensorflow::Tensor&gt; &gt;*, tensorflow::RunMetadata*) () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#17 0x00007f387799b2d7 in TF_Run_Helper(tensorflow::Session*, char const*, TF_Buffer const*, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, TF_Tensor**, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, TF_Buffer*, TF_Status*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#18 0x00007f387799b604 in TF_Run () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#19 0x00007f38778037e2 in tensorflow::TF_Run_wrapper_helper(TF_DeprecatedSession*, char const*, TF_Buffer const*, _object*, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, TF_Status*, tensorflow::gtl::InlinedVector&lt;_object*, 8&gt;*, TF_Buffer*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#20 0x00007f3877803be1 in tensorflow::TF_Run_wrapper(TF_DeprecatedSession*, TF_Buffer const*, _object*, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, TF_Status*, tensorflow::gtl::InlinedVector&lt;_object*, 8&gt;*, TF_Buffer*) () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#21 0x00007f38777ca793 in _wrap_TF_Run () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#22 0x00000000004c468a in PyEval_EvalFrameEx ()
#23 0x00000000004c2765 in PyEval_EvalCodeEx ()
#24 0x00000000004de6fe in ?? ()
#25 0x00000000004b0cb3 in PyObject_Call ()
#26 0x00000000004c6ad1 in PyEval_EvalFrameEx ()
#27 0x00000000004c2765 in PyEval_EvalCodeEx ()
#28 0x00000000004ca8d1 in PyEval_EvalFrameEx ()
#29 0x00000000004c2765 in PyEval_EvalCodeEx ()
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
#30 0x00000000004ca8d1 in PyEval_EvalFrameEx ()
#31 0x00000000004c2765 in PyEval_EvalCodeEx ()
#32 0x00000000004ca8d1 in PyEval_EvalFrameEx ()
#33 0x00000000004c2765 in PyEval_EvalCodeEx ()
#34 0x00000000004ca099 in PyEval_EvalFrameEx ()
#35 0x00000000004c2765 in PyEval_EvalCodeEx ()
#36 0x00000000004c2509 in PyEval_EvalCode ()
#37 0x00000000004f1def in ?? ()
#38 0x00000000004ec652 in PyRun_FileExFlags ()
#39 0x00000000004eae31 in PyRun_SimpleFileExFlags ()
#40 0x000000000049e14a in Py_Main ()
#41 0x00007f38a5e4c830 in __libc_start_main (main=0x49dab0 &lt;main&gt;, argc=2, argv=0x7ffd1a213618, init=&lt;optimised out&gt;, fini=&lt;optimised out&gt;, rtld_fini=&lt;optimised out&gt;, stack_end=0x7ffd1a213608)
    at ../csu/libc-start.c:291
#42 0x000000000049d9d9 in _start ()"><pre class="notranslate"><code class="notranslate">Core was generated by `python test_op.py'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  std::_Function_handler&lt;void (long long, long long), ZeroOutOp::Compute(tensorflow::OpKernelContext*)::{lambda(long long, long long)#1}&gt;::_M_invoke(std::_Any_data const&amp;, long long&amp;&amp;, std::_Any_data const&amp;) (__functor=..., __args#0=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c73&gt;, __args#1=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c78&gt;) at /usr/include/c++/5/functional:1871
1871		(*_Base::_M_get_pointer(__functor))(
[Current thread is 1 (Thread 0x7f38a6605700 (LWP 3771))]
(gdb) bt
#0  std::_Function_handler&lt;void (long long, long long), ZeroOutOp::Compute(tensorflow::OpKernelContext*)::{lambda(long long, long long)#1}&gt;::_M_invoke(std::_Any_data const&amp;, long long&amp;&amp;, std::_Any_data const&amp;) (__functor=..., __args#0=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c73&gt;, __args#1=&lt;unknown type in tfop.so, CU 0x0, DIE 0x41c78&gt;) at /usr/include/c++/5/functional:1871
#1  0x00007f3879dcc75d in tensorflow::thread::ThreadPool::Impl::ParallelFor(long long, long long, std::function&lt;void (long long, long long)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#2  0x00007f3879dcc93f in tensorflow::thread::ThreadPool::ParallelFor(long long, long long, std::function&lt;void (long long, long long)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#3  0x00007f3879d4d995 in tensorflow::Shard(int, tensorflow::thread::ThreadPool*, long long, long long, std::function&lt;void (long long, long long)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#4  0x00007f3850bfb79e in ZeroOutOp::Compute (this=0x62dacc0, context=0x7ffd1a20fe30) at tf_op.cpp:42
#5  0x00007f3879a2563c in tensorflow::ThreadPoolDevice::Compute(tensorflow::OpKernel*, tensorflow::OpKernelContext*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#6  0x00007f38799f5a58 in tensorflow::(anonymous namespace)::ExecutorState::Process(tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#7  0x00007f38799f61fa in std::_Function_handler&lt;void (), tensorflow::(anonymous namespace)::ExecutorState::ScheduleReady(tensorflow::gtl::InlinedVector&lt;tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, 8&gt; const&amp;, tensorflow::(anonymous namespace)::ExecutorState::TaggedNodeReadyQueue*)::{lambda()#1}&gt;::_M_invoke(std::_Any_data const&amp;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#8  0x00007f3879a035c4 in std::_Function_handler&lt;void (std::function&lt;void ()&gt;), tensorflow::GraphRunner::Run(tensorflow::Graph*, tensorflow::FunctionLibraryRuntime*, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;tensorflow::Tensor, std::allocator&lt;tensorflow::Tensor&gt; &gt;*)::{lambda(std::function&lt;void ()&gt;)#1}&gt;::_M_invoke(std::_Any_data const&amp;, std::function&lt;void ()&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#9  0x00007f38799e895b in std::function&lt;void (std::function&lt;void ()&gt;)&gt;::operator()(std::function&lt;void ()&gt;) const ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#10 0x00007f38799e9043 in tensorflow::(anonymous namespace)::ExecutorState::ScheduleReady(tensorflow::gtl::InlinedVector&lt;tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, 8&gt; const&amp;, tensorflow::(anonymous namespace)::ExecutorState::TaggedNodeReadyQueue*) [clone .part.246] () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#11 0x00007f38799ecf5e in tensorflow::(anonymous namespace)::ExecutorImpl::RunAsync(tensorflow::Executor::Args const&amp;, std::function&lt;void (tensorflow::Status const&amp;)&gt;) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#12 0x00007f3879a045e4 in tensorflow::GraphRunner::Run(tensorflow::Graph*, tensorflow::FunctionLibraryRuntime*, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;tensorflow::Tensor, std::allocator&lt;tensorflow::Tensor&gt; &gt;*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#13 0x00007f38799dce27 in tensorflow::ConstantFold(tensorflow::ConstantFoldingOptions const&amp;, tensorflow::FunctionLibraryRuntime*, tensorflow::Env*, tensorflow::Device*, tensorflow::Graph*, bool*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#14 0x00007f3879a02fea in tensorflow::GraphOptimizer::Optimize(tensorflow::FunctionLibraryRuntime*, tensorflow::Env*, tensorflow::Device*, std::unique_ptr&lt;tensorflow::Graph, std::default_delete&lt;tensorflow::Graph&gt; &gt;*) () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#15 0x00007f38799a9469 in tensorflow::DirectSession::GetOrCreateExecutors(tensorflow::thread::ThreadPool*, tensorflow::gtl::ArraySlice&lt;std::string&gt;, tensorflow::gtl::ArraySlice&lt;std::string&gt;, tensorflow::gtl::ArraySlice&lt;std::string&gt;, tensorflow::DirectSession::ExecutorsAndKeys**, tensorflow::DirectSession::RunStateArgs*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#16 0x00007f38799aa06c in tensorflow::DirectSession::Run(tensorflow::RunOptions const&amp;, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, std::vector&lt;tensorflow::Tensor, std::allocator&lt;tensorflow::Tensor&gt; &gt;*, tensorflow::RunMetadata*) () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#17 0x00007f387799b2d7 in TF_Run_Helper(tensorflow::Session*, char const*, TF_Buffer const*, std::vector&lt;std::pair&lt;std::string, tensorflow::Tensor&gt;, std::allocator&lt;std::pair&lt;std::string, tensorflow::Tensor&gt; &gt; &gt; const&amp;, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, TF_Tensor**, std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; const&amp;, TF_Buffer*, TF_Status*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#18 0x00007f387799b604 in TF_Run () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#19 0x00007f38778037e2 in tensorflow::TF_Run_wrapper_helper(TF_DeprecatedSession*, char const*, TF_Buffer const*, _object*, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, TF_Status*, tensorflow::gtl::InlinedVector&lt;_object*, 8&gt;*, TF_Buffer*) ()
   from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#20 0x00007f3877803be1 in tensorflow::TF_Run_wrapper(TF_DeprecatedSession*, TF_Buffer const*, _object*, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, tensorflow::gtl::InlinedVector&lt;char const*, 8&gt; const&amp;, TF_Status*, tensorflow::gtl::InlinedVector&lt;_object*, 8&gt;*, TF_Buffer*) () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#21 0x00007f38777ca793 in _wrap_TF_Run () from /home/sperkins/venv/mb/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#22 0x00000000004c468a in PyEval_EvalFrameEx ()
#23 0x00000000004c2765 in PyEval_EvalCodeEx ()
#24 0x00000000004de6fe in ?? ()
#25 0x00000000004b0cb3 in PyObject_Call ()
#26 0x00000000004c6ad1 in PyEval_EvalFrameEx ()
#27 0x00000000004c2765 in PyEval_EvalCodeEx ()
#28 0x00000000004ca8d1 in PyEval_EvalFrameEx ()
#29 0x00000000004c2765 in PyEval_EvalCodeEx ()
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
#30 0x00000000004ca8d1 in PyEval_EvalFrameEx ()
#31 0x00000000004c2765 in PyEval_EvalCodeEx ()
#32 0x00000000004ca8d1 in PyEval_EvalFrameEx ()
#33 0x00000000004c2765 in PyEval_EvalCodeEx ()
#34 0x00000000004ca099 in PyEval_EvalFrameEx ()
#35 0x00000000004c2765 in PyEval_EvalCodeEx ()
#36 0x00000000004c2509 in PyEval_EvalCode ()
#37 0x00000000004f1def in ?? ()
#38 0x00000000004ec652 in PyRun_FileExFlags ()
#39 0x00000000004eae31 in PyRun_SimpleFileExFlags ()
#40 0x000000000049e14a in Py_Main ()
#41 0x00007f38a5e4c830 in __libc_start_main (main=0x49dab0 &lt;main&gt;, argc=2, argv=0x7ffd1a213618, init=&lt;optimised out&gt;, fini=&lt;optimised out&gt;, rtld_fini=&lt;optimised out&gt;, stack_end=0x7ffd1a213608)
    at ../csu/libc-start.c:291
#42 0x000000000049d9d9 in _start ()
</code></pre></div>
<p dir="auto"><em>Please make sure that this is a build/installation issue. 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:build_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04):win10</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:tf_nightly_gpu_2.0_preview</li>
<li>Python version:python 3.6.3</li>
<li>Installed using virtualenv? pip? conda?:pip conda</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version:  cuda_10.0.130_411.31_win10.exe  cudnn-10.0-windows10-x64-v7.5.0.56.zip</li>
<li>GPU model and memory:GTX 1050</li>
</ul>
<p dir="auto"><strong>Describe the problem</strong><br>
I am trying to install tensorflow gpu on win10,but faild after many times.<br>
I also try to use conda,but failed. It takes me alomost one day to figure it out but failed finnaly,<br>
So upset and come here for help,thank you!<br>
<strong>Provide the exact sequence of commands / steps that you executed before running into the problem</strong><br>
pip install tf_nightly_gpu_2.0_preview-2.0.0.dev20190604-cp36-cp36m-win_amd64.whl</p>
<p dir="auto"><strong>Any 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.<br>
The error occurs when pip install tf-nightly-gpu-2.0-preview<br>
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\Users\XXXX\AppData\Local\Temp\pip-install-9z06414_\tf-nightly-gpu-2.0-preview\tf_nightly_gpu_2.0_preview-2.0.0.dev20190604.data/purelib/tensorflow/include/tensorflow/include/external/eigen_archive/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h'</p>