1
votes

System Info: AMD CPU Ubuntu 16.04 cuDNN v5.1 python 2.7

Unable to get tensorflow to run correctly when calling: "import tensorflow as tf"

Error/Output:

#

Traceback (most recent call last): File "test.py", line 2, in import tensorflow as tf File "/usr/local/lib/python2.7/dist-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 72, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 61, in from tensorflow.python import pywrap_tensorflow File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in _pywrap_tensorflow = swig_import_helper() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description) ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

#

Already tried ALL solutions in this similar thread: TensorFlow: libcudart.so.7.5: cannot open shared object file: No such file or directory

2
did you do sudo ldconfig ?Kochoba

2 Answers

1
votes

Thanks guys. Apparently the path and environment variables were set correctly and the libcart file was there, but the cuDNN was the wrong version installed. Had to use v6.0 instead of v5.1 which fixed the problem. Which is odd since this seems unrelated, but it was looking for a specific version. Thanks got TensorFlow working now!

0
votes

You need to find the path of libcudart.so and need it Environment.

To find the location of libcudart.so.8.0 .Try this

sudo find / -name libcudart.so

This will list the actual path which will in the following format

<-Directory->/libcudart.so.8.0

Copy the Directory and add the following in /etc/profile

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<-Directory->

Then update the source

source /etc/profile