I am getting the following Tensorflow import error after re-installing anaconda.
Import tensorflow as tf
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\ProgramData\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\ProgramData\Anaconda3\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.
See https://www.tensorflow.org/install/errors
Try reinstalling tensorflow:
pip install --upgrade tensorflow==2.0.0
Related
A piece of code runs on my local machine but throws the following error when running on a remote server. How do I identify the cause of the problem?
Have not encountered such problems before so want to know how to proceed to debug such errors.
Starting the execution.. Using TensorFlow backend. Traceback (most recent call last): File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import * File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper() File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/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 "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file) File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec) ImportError: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "main.py", line 14, in <module>
from network import * File "/home/biplavc/data/AoI/UAV_Age/network.py", line 11, in <module>
from utils import * File "/home/biplavc/data/AoI/UAV_Age/utils.py", line 2, in <module>
from keras.losses import mean_squared_error File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/__init__.py", line 3, in <module>
from . import utils File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/backend/__init__.py", line 89, in <module>
from .tensorflow_backend import * File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg) ImportError: Traceback (most recent call last): File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import * File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper() File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/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 "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file) File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec) ImportError: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
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.
(tf2) C:\Users\Pritam>python -c "import tensorflow as tf"
Traceback (most recent call last):
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Pritam\Anaconda3\envs\tf2\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:\Users\Pritam\Anaconda3\envs\tf2\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Pritam\Anaconda3\envs\tf2\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Pritam\Anaconda3\envs\tf2\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:\Users\Pritam\Anaconda3\envs\tf2\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Pritam\Anaconda3\envs\tf2\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.
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.
conda create --name tf-gpu
conda install -c aaronzs tensorflow-gpu
conda install -c anaconda cudatoolkit
conda install -c anaconda cudnn
conda install keras-gpu
see https://github.com/tensorflow/tensorflow/issues/22794
I am trying to install TensorFlow and I get this error when I try to import it :
Traceback (most recent call last):
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\USER\Anaconda3\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:\Users\USER\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\USER\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\USER\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\USER\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\USER\Anaconda3\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:\Users\USER\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\USER\Anaconda3\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.
python version : 3.7.6
conda version : 4.8.1
tensorflow version: 2.1.0 (the latest)
conda packages have the same versions and Microsoft C++ Redist 2015 is installed
Try installing or re-installing the C++ Redistributable from here. Make sure you are downloading the "Visual Studio 2015, 2017 and 2019" x64 version and restart your computer after the installation is complete.
I have installed tensorflow-gpu==1.10.0 for GPU usage on Ubuntu but when I call Keras ( e.g. import keras) I get the error: Failed to load the native TensorFlow runtime
I have been looking around the web but I could not find a clear answer. This is the error I get:
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/boxx/.local/lib/python3.6/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 "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "sltmSV.py", line 8, in <module>
from keras.models import Sequential
File "/home/boxx/.local/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/boxx/.local/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/home/boxx/.local/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/boxx/.local/lib/python3.6/site-packages/keras/backend/__init__.py", line 1, in <module>
from .load_backend import epsilon
File "/home/boxx/.local/lib/python3.6/site-packages/keras/backend/load_backend.py", line 89, in <module>
from .tensorflow_backend import *
File "/home/boxx/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/boxx/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/boxx/.local/lib/python3.6/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 "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
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.
Can someone point me a method or some documentation to install keras + tensorFlow for GPU on Ubuntu?
Thank you!
I am trying to train a program which uses tensorflow. I have the same downloaded (v=1.6). However, I get the following error..
I have reinstalled tensorflow.
I have even installed "msvcp140.dll" and placed in the directory where i have tensorflow installed.
Traceback (most recent call last):
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
<module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/python/pywrap_tensorflow_internal.py", line
28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/rashi/anaconda3/lib/python3.6/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 "/home/rashi/anaconda3/lib/python3.6/imp.py", line 242, in
load_module
return load_dynamic(name, filename, file)
File "/home/rashi/anaconda3/lib/python3.6/imp.py", line 342, in
load_dynamic
return _load(spec)
ImportError: libcuda.so.1: cannot open shared object file: No
such file or directory
During handling of the above exception, another exception
occurred:
Traceback (most recent call last):
File "train.py", line 2, in <module>
from model.ner_model import NERModel
File "/home/rashi/Desktop/sequence_tagging-
master/model/ner_model.py", line 3, in <module>
import tensorflow as tf
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/python/pywrap_tensorflow.py", line 74, in
<module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
<module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/rashi/anaconda3/lib/python3.6/site-
packages/tensorflow/python/pywrap_tensorflow_internal.py", line
28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/rashi/anaconda3/lib/python3.6/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 "/home/rashi/anaconda3/lib/python3.6/imp.py", line 242, in
load_module
return load_dynamic(name, filename, file)
File "/home/rashi/anaconda3/lib/python3.6/imp.py", line 342, in
load_dynamic
return _load(spec)
ImportError: libcuda.so.1: cannot open shared object file: No such
file or directory
Failed to load the native TensorFlow runtime.
I need to eradicate this issue/error. Please help me solve this problem!
PS: I am using Ubuntu 16.04 LTS, Python 3.6