tensorflow: [Install] Failed to load the native TensorFlow runtime.
System information
- Have I written custom code: Yes
- OS Platform and Distribution: windows 8.1 x64
- TensorFlow installed from: have no idea, I suppose binary
- TensorFlow version: 1.7
- Python version: 3.6.5
- Bazel version: ???
- GCC/Compiler version: ?
- CUDA/cuDNN version: cuDNN 7.0 for CUDA 9.0
- GPU model and memory: tensorflow-gpu, NVIDIA 4GHZ dualcore, 8GB RAM
- Exact command to reproduce:
python test.py
Describe the problem
I downloaded tensorflow and installed everything properly and getting error (click on it to expand):
Error
Traceback (most recent call last):
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helpe
r
return importlib.import_module(mname)
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\importlib\__i
nit__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routin
e failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import tensorflow as tf
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import * # pylint: disable=redefined-builtin
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\site-packages
\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helpe
r
return importlib.import_module(mname)
File "C:\Users\abcdef\AppData\Local\Programs\Python\Python36\lib\importlib\__i
nit__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routin
e failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_probl
ems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Asked on stack overflow and they suggested me to report an issue here because they dont know the answer. I also was thinking that I did something wrong, but maybe there is a bug somewhere. I installed everything needed, including cuda, cudnn, python latest, pip and I used pip to install tensorflow gpu
Source code
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
Edit
Here is my %PATH% environment variable:
Path
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVI
DIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;C:\Program Files (x86)\Common Files\
Intel\Shared Files\cpp\bin\Intel64;C:\Windows;C:\Windows\System32\Wbem;C:\Window
s\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.AC
E\Core-Static;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit
;C:\MinGW\bin;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolki
t;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Makefi
le;C:\windows\system32;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC;C:
\Users\abcdef\AppData\Local\Programs\Python\Python36\Scripts;C:\Users\abcdef\App
Data\Local\Programs\Python\Python36;C:\Program Files (x86)\Microsoft Visual Stud
io\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 29 (2 by maintainers)
try to install tensorflow version 1.5:
pip install --upgrade --ignore-installed tensorflow-gpu==1.5
I had same problem, probably becouse of CPU. Best sollution - Anaconda. xD Seriously it will solve everything +without downgrading anything. -Just uninstall everything(python,Cuda,cuDNN) clear PATHS… Conda will get everything. -Download Annaconda it will come with python 3.7(and will work with tensorflow^_^) -when install make mark so it sets up everything in PATH or set PATH yourself -run in cmd: “conda install tensorflow-gpu” woullaa I got CUDA-10.0.13/cuDNN-7.3.1 and Tensorflow-gpu 1.13.1 and when time comes -to update every package “conda update --all” Best of Luck!
I have the same problem. I tried everything but it is not solved. please help
Hey, guys. I tell a story about me, last time I import TensorFlow in its source file directory, it happened this fault, and I use “cd …” (then import TensorFlow)solve this problem. Maybe it’s not one problem, but may this help.
This worked for me. Thank you.