-
Notifications
You must be signed in to change notification settings - Fork 74.2k
-
Notifications
You must be signed in to change notification settings - Fork 74.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to load the native tensorflow runtime #17807
Comments
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. |
Thanks you for your response. this shows up when I type in "import tensorflow as tf" in python. I used the command "pip3 install --upgrade tensorflow" as specified in www.tensorflow.org/install/install_windows. I am under the assumption that this version is the CPU version of tensorflow. |
I have the same problem. During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_probl for some common reasons and solutions. Include the entire stack trace OS Platform and Distribution: Note: Should I downgrade python as mentioned in: I added .DLL to PATHTEXT system variable, |
It looks like TensorFlow cannot find a required DLL. Issues #5949 and #10033 discuss similar problems. Please check if any of the solutions described there help you. pip3 install --upgrade tensorflow installs CPU-only version. @Rayan47 - I apologize but Anaconda installations are supported by the community not us. |
Hi All, I have the same problem, fighting with it for couple of evenings now, I wanted to learn some ML, but got stuck right at the beginning. My issues are with tensorflow for CPU. I already tried:
Here is my traceback: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace I've also tried Miniconda and after installing both Python and then Tensorflow on new environment I encounter the same issue. My temporary workaround is to install Tensorflow 1.5 - works without problems. |
if 1.6 fails and 1.5 works fine, you have a CPU that does not support AVX instruction sets. |
It fails with an error "ImportError: DLL load failed with error code". Can this be due to AVX? @aoptomus, @J4K8B - Can you try building TensorFlow from source on your machine and see if it fixes your problem? |
Yes, since DLL is compiled with AVX instructions built in, loading fails with unknown instructions. |
The only workaround then is to build TensorFlow from source. |
For me, the issue was with protobuf. That was not installed properly, I reinstalled it and then it works. |
That was the solution in my case, i updated to protobuf 3.6.1 through conda and it worked. |
@ahmed1186 I have protobuf installed and it still gives the same error, do you have anything else installed that helps? |
I actually don't recall using anything else other than uninstalling tensorflow then using |
ImportError Traceback (most recent call last) c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper() c:\users\tapashetti-sr\tf_gpu\lib\imp.py in load_module(name, file, filename, details) c:\users\tapashetti-sr\tf_gpu\lib\imp.py in load_dynamic(name, path, file) ImportError: DLL load failed: The specified module could not be found. During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow_init_.py in c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python_init_.py in c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in ImportError: Traceback (most recent call last): Getting this traceback while using tensorflow-gpu with virtualenv. tensorflow cpu works fine. |
I didn't have to uninstall tensorflow at all. I simply ran Thanks, @ahmed1186 |
Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. for some common reasons and solutions. Include the entire stack trace Process finished with exit code 1 |
Same error Failed to load the native TensorFlow runtime.` I installed tensorflow 1.15 and the problem is solved. |
Approach 1 So, according to the information you provided, follow these steps : Install Visual Studio C++ Redistributable 2015 Update 3. pip install tensorflow-1.12.0-cp36-cp36m-win_amd64.whl If it shows any error, try changing the relative path to an absolute one. TensorFlow is installed successfully. Approach 2 Install Anaconda. It uses a package manager named conda which is similar to pip. Create a new Conda environment. conda create --name mytfenv Install TensorFlow ( version=1.10.0 ) conda install tensorflow One of the methods would work for you. I personally followed both the approachs as my CPU specifications match yours. |
I had Visual Studio 2017, i installed Visual Studio 2019 and it is ok now thanks |
this is the full stack trace
Traceback (most recent call last):
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\importlib_init_.py", line 126, in import_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
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed with error code -1073741795
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in
import tensorflow as tf
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import *
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\importlib_init_.py", line 126, in import_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
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed with error code -1073741795
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "C:\Users\Skinet\AppData\Local\Programs\Python\Python35\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
The text was updated successfully, but these errors were encountered: