This question already has answers here:
ImportError: libcublas.so.9.0: cannot open shared object file
(12 answers)
Closed 4 years ago.
I was using Paperspace's machine(has all the ml stuff built in) to train a model. Everything seemed fine until I ran the training file. Error message shown below:
Traceback (most recent call last):
File "/home/paperspace/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/paperspace/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/paperspace/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/paperspace/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/paperspace/anaconda3/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 "train.py", line 8, in <module>
from nmt import nmt
File "/home/paperspace/Desktop/nmt-chatbot/nmt/nmt/nmt.py", line 26, in <module>
import tensorflow as tf
File "/home/paperspace/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/paperspace/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/paperspace/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/paperspace/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/paperspace/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/paperspace/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/paperspace/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/paperspace/anaconda3/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.
I've tried install cuba9.0 & cudnn7.0.5, doesn't seem to help.
Turns out it's Tensorflow version problem. The following steps solved the problem
pip uninstall tensorflow
pip install tensorflow==1.4 #yourdesiredTFversion
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.
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
I wanted to get started using tensorflow.
i downloaded tensorflow-1.12.0-cp37-cp37m-win_amd64.whl and installed it via pip which worked.
but when i want to run the tensorflow tutorialcode it throws the following error:
Traceback (most recent call last):
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\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\johnson\AppData\Local\Programs\Python\Python37\lib\imp.py", > line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\johnson\AppData\Local\Programs\Python\Python37\lib\imp.py", > line 342, 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/johnson/PycharmProjects/Data
exploration/MNISTTensorflow.py", line 4, in
import tensorflow as tf
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-packages\tensorflow__init__.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-packages\tensorflow\python__init__.py", line 49,
in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\lib\site-
packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\johnson\PycharmProjects\Data exploration\Data
exploration\venv\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\johnson\AppData\Local\Programs\Python\Python37\lib\imp.py",
line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\johnson\AppData\Local\Programs\Python\Python37\lib\imp.py",
line 342, 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
i tried downloading and installing the 1.12.0 version. but when i want to add the package to the interpreter (via "settings" in pycharm), only the 1.13.1 version showed up (which was already uninstalled). that just adds to my confusion. as you surely can see, im new to python. i hope my questions are not too stupid. thank you!
i use:
- windos 7 (64bit)
- Python 3.7
- PyCharm community edition 2018.3.2
- GeForce GT 425m
- i5 CPU M580
I am able to import tensorflow using python 2.7. But I am getting the following error while trying to import tensorflow using python 3.6.4:
Traceback (most recent call last):
File "/root/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/root/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/root/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 "/root/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/root/anaconda3/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 "<stdin>", line 1, in <module>
File "/root/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/root/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/root/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 "/root/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/root/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/root/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 "/root/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/root/anaconda3/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.
I have cuda 9.1 and tensorflow 1.6 installed in my system.
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
It seems your Tensorflow version for Python 3.6.x has been compiled for CUDA 9.0, not 9.1.
So far for CUDA 9.1, you may have to build Tensorflow from source yourself (Github discussion, install doc).