Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory (Windows)

I am trying to install the object-detection module of tensorflow but when running the following command:

python3 object_detection/builders/model_builder_test.py

I get the following error. I have installed CUDA 8.0,9.0,9.1, and cuDNN 6 and 7 but still have the following error. I appreciate your advice, thank you!

Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python3.5/dist-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.5/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib/python3.5/imp.py", line 342, 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 "object_detection/builders/model_builder_test.py", line 18, in import tensorflow as tf File "/usr/local/lib/python3.5/dist-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/init.py", line 49, in from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/lib/python3.5/dist-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.5/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib/python3.5/imp.py", line 342, 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.

like image 531
Justin San Juan Avatar asked Feb 04 '18 07:02

Justin San Juan


1 Answers

Put your cuda path into environment variable.

LD_LIBRARY_PATH = /usr/local/cuda/lib64:$LD_LIBRARY_PATH

put this line into your bash profile and update it with source .bash_profile. Open new terminal and run it again. if you get the same error, take a look at this solution.

One more thing can also happen. You may have problem with old installations. make sure you've removed all old version of tensorflow and cuda. (I mean old installation in your pc). Install the version you want on a clean space. If it's not working as well, take a look at this solution

like image 70
Hazarapet Tunanyan Avatar answered Nov 15 '22 08:11

Hazarapet Tunanyan