3
votes

I am having a huge troube to run this in my code. I already tried to reinstall the packges, install in the environment etc, but I don't think I'm doing it correctly.

import keras 
from keras.models import Sequential
from keras.layers import Dense"

I get this message:

Using TensorFlow backend.

Traceback (most recent call last):

File "", line 1, in import keras

File "/home/wagner/anaconda3/lib/python3.5/site-packages/keras/init.py", line 3, in from . import utils

File "/home/wagner/anaconda3/lib/python3.5/site-packages/keras/utils/init.py", line 6, in from . import conv_utils

File "/home/wagner/anaconda3/lib/python3.5/site-packages/keras/utils/conv_utils.py", line 3, in from .. import backend as K

File "/home/wagner/anaconda3/lib/python3.5/site-packages/keras/backend/init.py", line 83, in from .tensorflow_backend import *

File "/home/wagner/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1, in import tensorflow as tf

File "/home/wagner/.local/lib/python3.5/site-packages/tensorflow/init.py", line 24, in from tensorflow.python import *

File "/home/wagner/.local/lib/python3.5/site-packages/tensorflow/python/init.py", line 49, in from tensorflow.python import pywrap_tensorflow

File "/home/wagner/.local/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 72, in raise ImportError(msg)

ImportError: Traceback (most recent call last): File "/home/wagner/.local/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/home/wagner/.local/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/home/wagner/.local/lib/python3.5/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/wagner/anaconda3/lib/python3.5/imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "/home/wagner/anaconda3/lib/python3.5/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

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.

1
Tensorflow-GPU needs Cuda 8.0 and CuDNN 6.0. Higher CuDNN versions can cause this error.Daniel Möller

1 Answers

0
votes

What versions of TensorFlow, cuda and cudnn are you running?

Running the following command in the working directory solved the problem for me:

export LD_LIBRARY_PATH=/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH

But you will have to replace the /usr/local/cuda-8.0/extras/CUPTI/lib64 with the relevant location on your machine.