0

I am trying to install tensorflow gpu on my laptop running MX150. I updated my NVIDIA driver, installed CUDA , installed CUDnn. But still not able to import Tensorflow. getting following error

>>> import tensorflow as tf
Traceback (most recent call last):
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/rohan/anaconda3/envs/tensorflow_env/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/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.8.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 "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/rohan/anaconda3/envs/tensorflow_env/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/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/home/rohan/anaconda3/envs/tensorflow_env/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory
Anuvrat Parashar
  • 2,960
  • 5
  • 28
  • 55

2 Answers2

0

It looks like there is a mismatch between your python version and your CUDA version. please check your versions by:

python --version

and

nvcc --version

What is yuor OS? What version of Tensorflow your are trying to run? I suggest to uninstall tensorflow and reinstall it after you have the currect version of Python and CUDA. You can follow Tesnoeflow with gpu documentation.

Also check this issue which is similar to yours libcublas.so.8.0 error with tensorflow

Idan Azuri
  • 623
  • 4
  • 17
  • python version-3.6.5 cuda version- 10.0, tensorflow-gpu-1.4.0 iam running it on ubuntu 18.04 , iam able to obtain version of tensorflow through terminal but not able to import tensorflow. – Rohan Gaonkar Oct 02 '18 at 17:17
  • According to [Install GPU version of tensorflow](https://www.python36.com/install-gpu-version-of-tensorflow/) - I recommend you to uninstall CUDA and reinstall CUDA 8.0 and cuDNN 6.0 . There are also instructions how to do that in the link. – Idan Azuri Oct 03 '18 at 09:07
  • I cannot proceed because my ubuntu version is 18.04 and cuda 8 is available for ubuntu 16.04 and 14.04 – Rohan Gaonkar Oct 07 '18 at 03:19
  • So according to the table [here](https://www.tensorflow.org/install/source#tested_source_configurations) you need TF version > 1.6.0 – Idan Azuri Oct 11 '18 at 13:08
0

you need python version 3.7 with cuda toolkit 10.0 I also had the same error and solved it by setting the environmental variables for cuda path in your system advanced settings.

If you have installed two or more cuda versions make sure to delete rest from environment variables .

use the below code to check if gpu is being utilizd in jupyter notebook.

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())