• Register
0 votes
177 views

Problem :

I am facing following error while importing the Tensorflow.

>>> import tensorflow

Traceback (most recent call last):

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>

from tensorflow.python.pywrap_tensorflow_internal import *

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 33, in <module>

_pywrap_tensorflow_internal = swig_import_helper()

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 39, in swig_import_helper

_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

File "/home/alecxe/anaconda3/lib/python3.6/imp.py", line 151, in load_module

return load_dynamic(name, filename, file)

File "/home/alecxe/anaconda3/lib/python3.6/imp.py", line 363, in load_dynamic

return _load(spec)

ImportError: libcudnn.so.6: 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 "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 35, in <module>

from tensorflow.python import *

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 69, in <module>

from tensorflow.python import pywrap_tensorflow

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 32, in <module>

raise ImportError(msg)

ImportError: Traceback (most recent call last):

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 53, in <module>

from tensorflow.python.pywrap_tensorflow_internal import *

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 49, in <module>

_pywrap_tensorflow_internal = swig_import_helper()

File "/home/alecxe/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 33, in swig_import_helper

_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

File "/home/alecxe/anaconda3/lib/python3.6/imp.py", line 151, in load_module

return load_dynamic(name, filename, file)

File "/home/alecxe/anaconda3/lib/python3.6/imp.py", line 363, in load_dynamic

return _load(spec)

ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

I tried to add the path variables too as below :

$ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}

$ export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Then my system detects nvcc. But as soon as I open the terminal windows, and type nvcc -V in the  new terminal window it again shows that not installed

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution  :

I met this problem in recent past while I was installing the tensorflow-gpu according to the official installing document. I have managed to solve it by changing my version of tensorflow-gpu.

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp36-cp36m-linux_x86_64.whl
9 7 4
38,600 points

Related questions

0 votes
1 answer 323 views
323 views
Problem : I am building the TensorFlow from the source code. The build appears to succeed; but, when my TensorFlow program invokes the import tensorflow, one or both of the following errors starts appearing: · ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory · ImportError: libcudnn.5: cannot open shared object file: No such file or directory
asked Dec 9, 2019 alecxe 7.5k points
0 votes
1 answer 5 views
5 views
Problem: I am currently trying to run a project from GitHub: github.com/nilboy/pixel-recursive-super-resolution After installing ubuntu on VM, I installed python with tensorflow 2.7 using the pip command. When I try to run the training session with python I get this error: ... I don't have an NVIDIA GPU and I am trying to run this project on the CPU. Can you help identify the tensorflow problem?
asked Apr 25 sumaiya simi 43.9k points
0 votes
1 answer 10 views
10 views
Problem: I am currently trying to run a project from GitHub: https://github.com/nilboy/pixel-recursive-super-resolution After installing ubuntu on VM, I installed python with tensorflow 2.7 using the pip command. When I try to run the training session with ... to run this project on the CPU. Can you help identify the tensorflow problem? Source: https://www.tensorflow.org/install/install_linux
asked Apr 30 ochena 23.3k points
0 votes
1 answer 5 views
5 views
Problem: I am trying to use tensorflow-gpu on my system. I have re-installed it many times, it gives the error give below. But when I use tensorflow-cpu it works fine. I have cuda 8.0 toolkit installed and cudnn 5.1. Traceback ( ... /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.
asked Apr 30 Yeamin 22k points
0 votes
1 answer 35 views
35 views
Problem : I am facing following error : Importerror: libcuda.so.1: cannot open shared object file: no such file or directory .
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 156 views
156 views
Problem : I am very new to tensorflow-gpu, I want to use the tensorflow-gpu on my system. I have already tried to reinstall tensorflow-gpu many times but still it shows me the following error.If I use the tensorflow-cpu then it works correctly. Please Note: I ... ) ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory Can somebody help me in fixing above error ?
asked Feb 19, 2020 mphil 2.3k points
0 votes
2 answers 146 views
146 views
Problem : I have recently installed the cuda 8.0 and cuda 9.0 in the Gpu support system. I encountered the below error while importing from the keras module. It says it is unable to load the native tensorflow runtime. I have received the error log as below: Traceback ... is, Cuda compilation tools, release 8.0, V8.0.61 Is it the clash between two cuda versions? Have anyone solved this before?
asked Feb 18, 2020 mphil 2.3k points
0 votes
1 answer 1.9K views
1.9K views
Problem : I am facing following error : ImportError: libcuda.so.1: cannot open shared object file: No such file or directory Failed to load the native TensorFlow runtime. Above error comes up when I tried to import the tensorflow. Is there anybody who has faced this error before and know the solution on it?
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 290 views
290 views
Problem : I have installed Cuda 10.1 and cudnn on Ubuntu 18.04 for the first time and it seems to be installed properly as when I type nvcc and nvidia-smi I am getting proper response. I have also installed tensorflow using following command: user:~$ sudo ... solutions. Include the entire stack trace above this error message when asking for help. Am I missing something? How to resolve this issue?
asked Nov 27, 2019 AbhijitJ 38.6k points
0 votes
1 answer 901 views
901 views
Problem : While trying to import the OpenCV, using import cv2 I facing the below error: /usr/local/lib/python2.7/dist-packages/cv2/__init__.py in <module>() 12 13 # make IDE's (PyCharm) autocompletion happy ----> 14 from .cv2 import * 15 16 # wildcard import ... - I am trying to play around with the Google's new Colaboratory tool. Please let me know if someone have solution for the above issue.
asked Dec 18, 2019 alecxe 7.5k points