Reputation: 25
First I installed tensorflow 2.0.0rc1 While importing tensorflow in python 3.6.9 it said import error then I tried tensorflow 1.14.0 but then also error occurred:
Traceback (most recent call last):
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\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\SUSAMA\Anaconda3\envs\tensor\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\imp.py", line 343, in load_dynamic
return _load(spec)
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/SUSAMA/PycharmProjects/tensorflow/ten.py", line 1, in <module>
import tensorflow as tf
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\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\SUSAMA\Anaconda3\envs\tensor\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\SUSAMA\Anaconda3\envs\tensor\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code -1073741795
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
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
Please tell how to correct it.
Upvotes: 2
Views: 216
Reputation:
Installing TensorFlow (TF) CPU prebuilt binaries:
TensorFlow release binaries version 1.6 and higher are prebuilt with AVX instruction sets.
See hardware requirements to know more.
Therefore on any CPU that does not have these instruction sets, either CPU or GPU version of TF will fail to load. Apparently, your CPU model does not support AVX instruction sets. You can still use TensorFlow with the alternatives given below:
pip install
to install any other preferred TF version. Upvotes: 1
Reputation: 1
For me it was that my CPU doesnt support AVX instructions, which are used by Tensorflow > 1.5 causing this import Error. Possible Fixes are afaik: 1.)Tensorflow 1.5:
pip install tensorflow==1.5
2.)Use a prebuilt wheel without AVX intructions (For example for Windows: https://github.com/fo40225/tensorflow-windows-wheel)
3.)Build Tensorflow from Source for your system.
Upvotes: 0