Skip to content
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

Closed
kulten opened this issue Mar 18, 2018 · 21 comments
Closed

Failed to load the native tensorflow runtime #17807

kulten opened this issue Mar 18, 2018 · 21 comments
Assignees
Labels
type:build/install Build and install issues

Comments

@kulten
Copy link

kulten commented Mar 18, 2018

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.

@tensorflowbutler tensorflowbutler added the stat:awaiting response Status - Awaiting response from author label Mar 18, 2018
@tensorflowbutler
Copy link
Member

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.
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce

@kulten
Copy link
Author

kulten commented Mar 19, 2018

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.
OS : windows 7 64 bit.
tensorflow version: 1.6.0
GPU: Nvidia gt 430 (1 gb)

@Rayan47
Copy link

Rayan47 commented Mar 19, 2018

I have the same problem.
Stack Trace:
Traceback (most recent call last):
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\importlib_init_.py", lin
e 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
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 "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\importlib_init
.py", lin
e 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow__
init__.py", line 24, in
from tensorflow.python import *
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\importlib_init_.py", lin
e 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
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 "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\py
thon\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "C:\Users\Rayan\Anaconda3\envs\tensorflow\lib\importlib_init
.py", lin
e 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

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.�

OS Platform and Distribution:
Windows 8.1
TensorFlow installed from
Anaconda(using: https://www.tensorflow.org/install/install_windows )
TensorFlow version
Can't figure out. (Installed yesterday)
Bazel version
Wasn't a source installation
CUDA/cuDNN version:
Not a GPU installation
GPU model and memory:
No GPU
Exact command to reproduce:
activate tensorflow
python
import tensorflow

Note:

Should I downgrade python as mentioned in:
https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso

I added .DLL to PATHTEXT system variable,
still same error. Should I undo that?

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Mar 19, 2018
@tatianashp
Copy link
Member

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.
pip3 install --upgrade tensorflow-gpu installs GPU version (https://www.tensorflow.org/install/install_windows)

@Rayan47 - I apologize but Anaconda installations are supported by the community not us.

@tatianashp tatianashp added stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues labels Mar 19, 2018
@kulten
Copy link
Author

kulten commented Mar 23, 2018

I first faced the same issue as #5949 and fixed it, Issue #10033 seems to be for the GPU version and I downloaded the CPU only version of tensorflow. The issue has still not been resolved.

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Mar 25, 2018
@J4K8B
Copy link

J4K8B commented Mar 25, 2018

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:

  • installing Visual C++ Redistributable 2015 x64/MSVCP140.DLL - didn't help
  • uninstalling all Python versions, installations, environments, to start everything clean and go step by step - didn't help

Here is my traceback:

Traceback (most recent call last):
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed: Procedura inicjowania biblioteki dołączanej dynamicznie (DLL) nie powiodła się.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\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\jakub\AppData\Local\Programs\Python\Python36\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import *
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed: Procedura inicjowania biblioteki dołączanej dynamicznie (DLL) nie powiodła się.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\jakub\AppData\Local\Programs\Python\Python36\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\jakub\AppData\Local\Programs\Python\Python36\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: 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.


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.

@tatianashp
Copy link
Member

@gunan - Do you have any thoughts on this Windows installation problem? @J4K8B reports that it occurs with TensorFlow 1.6, while TensorFlow 1.5 works just fine.

@gunan
Copy link
Contributor

gunan commented Mar 29, 2018

if 1.6 fails and 1.5 works fine, you have a CPU that does not support AVX instruction sets.

@tatianashp
Copy link
Member

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?

@gunan
Copy link
Contributor

gunan commented Mar 29, 2018

Yes, since DLL is compiled with AVX instructions built in, loading fails with unknown instructions.

@tatianashp
Copy link
Member

The only workaround then is to build TensorFlow from source.

@sramitsharma
Copy link

For me, the issue was with protobuf. That was not installed properly, I reinstalled it and then it works.

@ahmed1186
Copy link

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.

@mynktwri
Copy link

mynktwri commented Feb 12, 2019

@ahmed1186 I have protobuf installed and it still gives the same error, do you have anything else installed that helps?
python 3.6
tensorflow 1.12
protobuf 3.6.1
Windows 8.1 64-bit
CPU: i7-4510U

@ahmed1186
Copy link

@ahmed1186 I have protobuf installed and it still gives the same error, do you have anything else installed that helps?
python 3.6
tensorflow 1.12
protobuf 3.6.1
Windows 8.1 64-bit
CPU: i7-4510U

I actually don't recall using anything else other than uninstalling tensorflow then using conda install tensorflow-gpu,
which reinstalled all tensorflow 1.12 dependencies that I already had (CUDA 9.0, Cudnn 3.7.1 and others), the only thing that was updated was "protobuf" and then it worked.

@SunilTapashetti
Copy link

ImportError Traceback (most recent call last)
c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import version

c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper

c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:

c:\users\tapashetti-sr\tf_gpu\lib\imp.py in load_module(name, file, filename, details)
242 else:
--> 243 return load_dynamic(name, filename, file)
244 elif type_ == PKG_DIRECTORY:

c:\users\tapashetti-sr\tf_gpu\lib\imp.py in load_dynamic(name, path, file)
342 name=name, loader=loader, origin=path)
--> 343 return _load(spec)
344

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)
in
----> 1 import tensorflow as tf
2

c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow_init_.py in
22
23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
25
26 from tensorflow._api.v1 import app

c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python_init_.py in
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers

c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
---> 74 raise ImportError(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
File "c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\users\tapashetti-sr\tf_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "c:\users\tapashetti-sr\tf_gpu\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "c:\users\tapashetti-sr\tf_gpu\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Getting this traceback while using tensorflow-gpu with virtualenv. tensorflow cpu works fine.

@mmattklaus
Copy link

I actually don't recall using anything else other than uninstalling tensorflow then using conda install tensorflow-gpu,
which reinstalled all tensorflow 1.12 dependencies that I already had (CUDA 9.0, Cudnn 3.7.1 and others), the only thing that was updated was "protobuf" and then it worked.

I didn't have to uninstall tensorflow at all. I simply ran conda install tensorflow-gpu and it upgraded some packages and downloaded some (including protobuf). I realised the download size of tensorflow, tensorflow-gpu were each < 2MB, indicating that it saw my currently installed version.
I am on Windows 10, Python 3.7 and Conda 4.6. Using Tensorflow, -gpu, tensorboard 1.13

Thanks, @ahmed1186

@mmkumar1
Copy link

mmkumar1 commented Jan 7, 2020

Traceback (most recent call last):
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(file)])
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python_init_.py", line 66, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/MMKUMAR/PycharmProjects/JARVIS/Tensorflow.py", line 1, in
import tensorflow
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import *
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python_init_.py", line 72, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(file)])
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python_init_.py", line 66, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\MMKUMAR\Desktop\AdityaJarvis\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'

Failed to load the native TensorFlow runtime.

See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

Process finished with exit code 1

@dglent
Copy link

dglent commented Apr 19, 2020

Same error
Windows 7 64bits
tensorrflow 2.1.0
`ImportError: Traceback (most recent call last):
File "C:\User\User95\Python-3.7.3-64bits\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\User\User95\Python-3.7.3-64bits\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\User\User95\Python-3.7.3-64bits\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\User\User95\Python-3.7.3-64bits\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\User\User95\Python-3.7.3-64bits\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.`

I installed tensorflow 1.15 and the problem is solved.
My CPU is Intel i5-5200U 2.20 GHZ and should be compatible with AVX instructions ?
Instruction Set Extensions
Intel® SSE4.1, Intel® SSE4.2, Intel® AVX2
https://ark.intel.com/content/www/us/en/ark/products/85212/intel-core-i5-5200u-processor-3m-cache-up-to-2-70-ghz.html#tab-blade-1-0-7

@ompsingh
Copy link

Approach 1

So, according to the information you provided, follow these steps :

Install Visual Studio C++ Redistributable 2015 Update 3.
Since your CPU does not support AVX, go to this repository. It contains TensorFlow builds supporting SSE, which is compatible with Intel Pentium.
Follow this path in the repo -> tensorflow-windows-wheel/1.12.0/py36/CPU/sse2
Download the .whl file ( or click here ).
Now, we need to install this file. Use,

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.

@dglent
Copy link

dglent commented May 10, 2020

I had Visual Studio 2017, i installed Visual Studio 2019 and it is ok now thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests