title: Cannot import Tensorflow for GPU on Windows 10
body: <p>Trying to install the gpu version of Tensorflow on my machine, but I'm getting this error when trying 'import tensorflow'</p>
  
  <hr>
  
  <blockquote>
    <p>ImportError                               Traceback (most recent call
    last)
    C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflo
    w_internal.py in swig_import_helper()
         17         try:
    ---> 18             return importlib.import_module(mname)
         19         except ImportError:</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib__init__.py in
    import_module(name, pac kage)
        125             level += 1
    --> 126     return _bootstrap._gcd_import(name[level:], package, level)
        127</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap.py in
    _gcd_import(name, pac kage, level)</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap.py in
    _find_and_load(name, import_)</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap.py in
    _find_and_load_unlock ed(name, import_)</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap.py in
    _load_unlocked(spec)</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap.py in
    module_from_spec(spec )</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap_external.py in
    create_modul e(self, spec)</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib_bootstrap.py in
    _call_with_frames_rem oved(f, *args, **kwds)</p>
    
    <p>ImportError: DLL load failed: The specified module could not be found.</p>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <p>ImportError                               Traceback (most recent call
    last)
    C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflo
    w.py in ()
         40     sys.setdlopenflags(_default_dlopen_flags | ctypes.RTLD_GLOBAL)
    ---> 41   from tensorflow.python.pywrap_tensorflow_internal import *
         42   from tensorflow.python.pywrap_tensorflow_internal import <strong>version</strong></p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflo
    w_internal.py in ()
         20             return importlib.import_module('_pywrap_tensorflow_internal' )
    ---> 21     _pywrap_tensorflow_internal = swig_import_helper()
         22     del swig_import_helper</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflo
    w_internal.py in swig_import_helper()
         19         except ImportError:
    ---> 20             return importlib.import_module('_pywrap_tensorflow_internal' )
         21     _pywrap_tensorflow_internal = swig_import_helper()</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\importlib__init__.py in
    import_module(name, pac kage)
        125             level += 1
    --> 126     return _bootstrap._gcd_import(name[level:], package, level)
        127</p>
    
    <p>ImportError: No module named '_pywrap_tensorflow_internal'</p>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <p>ImportError                               Traceback (most recent call
    last)  in ()
    ----> 1 import tensorflow</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow__init__.py
    in  ()
         22
         23 # pylint: disable=wildcard-import
    ---> 24 from tensorflow.python import *
         25 # pylint: enable=wildcard-import
         26</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python__init__.py
    in &lt; module>()
         49 import numpy as np
         50
    ---> 51 from tensorflow.python import pywrap_tensorflow
         52
         53 # Protocol buffers</p>
    
    <p>C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflo
    w.py in ()
         50 for some common reasons and solutions.  Include the entire stack trace
         51 above this error message when asking for help.""" % traceback.format_exc ()
    ---> 52   raise ImportError(msg)
         53
         54 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-
    too-long</p>
    
    <p>ImportError: Traceback (most recent call last):   File
    "C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_t
    ensorflow_internal.py", line 18, in swig_import_helper
        return importlib.import_module(mname)   File "C:\Users\snh5_000\Anaconda3\lib\importlib__init__.py", line 126, in
    imp ort_module
        return _bootstrap._gcd_import(name[level:], package, level)   File "", line 986, in _gcd_import   File
    "", line 969, in _find_and_load   File
    "", line 958, in _find_and_load_unlocked 
    File "", line 666, in _load_unlocked<br>
    File "", line 577, in module_from_spec<br>
    File "", line 906, in
    create_module   File "", line 222, in
    _call_with_frames_removed ImportError: DLL load failed: The specified module could not be found.</p>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <p>Traceback (most recent call last):   File
    "C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_t
    ensorflow.py", line 41, in 
        from tensorflow.python.pywrap_tensorflow_internal import *   File "C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_t
    ensorflow_internal.py", line 21, in 
        _pywrap_tensorflow_internal = swig_import_helper()   File "C:\Users\snh5_000\Anaconda3\lib\site-packages\tensorflow\python\pywrap_t
    ensorflow_internal.py", line 20, in swig_import_helper
        return importlib.import_module('_pywrap_tensorflow_internal')   File "C:\Users\snh5_000\Anaconda3\lib\importlib__init__.py", line
    126, in imp ort_module
        return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal'</p>
    
    <p>Failed to load the native TensorFlow runtime.</p>
    
    <p>See
    <a href="https://www.tensorflow.org/install/install_sources#common_installation_probl" rel="noreferrer">https://www.tensorflow.org/install/install_sources#common_installation_probl</a>
    ems</p>
    
    <p>for some common reasons and solutions.  Include the entire stack trace
    above this error message when asking for help.</p>
  </blockquote>
  
  <p>Running Windows 10, Python 3.5.2, Anaconda 4.2.0 64-bit. Installed tensorflow-gpu using 'pip install tensorflow-gpu'.</p>
  
  <p>I've attempted the fixes in <a href="https://github.com/tensorflow/tensorflow/issues/5949" rel="noreferrer">https://github.com/tensorflow/tensorflow/issues/5949</a>, namely running Microsoft Visual C++ 2015 Redistributable Update 3 and confirming I had the following DLLs in System32/SysWOW64/my Python folder:</p>
  
  <blockquote>
    <p>KERNEL32.dll</p>
    
    <p>WSOCK32.dll</p>
    
    <p>WS2_32.dll</p>
    
    <p>SHLWAPI.dll</p>
    
    <p>python35.dll</p>
    
    <p>MSVCP140.dll</p>
    
    <p>VCRUNTIME140.dll</p>
    
    <p>api-ms-win-crt-runtime-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-heap-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-utility-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-stdio-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-string-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-math-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-convert-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-environment-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-filesystem-l1-1-0.dll</p>
    
    <p>api-ms-win-crt-time-l1-1-0.dll</p>
  </blockquote>
  
  <p>It's worth noting that the cpu version of Tensorflow imports and runs just fine, but when I attempt to use the gpu version I get the above error. I presume this is due to a mistake on my part in configuring the CUDA toolkit/cudNN, but I think I did everything listed in the instructions correctly. I made sure I had an entry in the PATH environment variable for the CUDA toolkit (leading to \bin and \libnvvp) and added one in for cudNN  (leading to \cuda).</p>
  
  <p>Any thoughts or other information you'd need to help?</p>