Search code examples
pythontensorflowlinux-mint

Error after install of tensor flow 1.5 (linux mint 18.3)


Just finished the installation of tensor flow (gpu enable) 1.5 On a Clevo laptop, under linux mint 18.3 with nvidia 1060 gpu and when running the test program python premade_estimator.py I get the following error code :

    Traceback (most recent call last):
  File "premade_estimator.py", line 20, in <module>
    import tensorflow as tf
  File "/home/empereur/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/home/empereur/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/empereur/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/empereur/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/empereur/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/empereur/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.9.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.

I have installed the cuda driver 9.0 as showed by that :

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

I look at the forum, and most of the problem where either conflict between two version (not my case) or the path to version 9.0 not done (which i think I did)

I am a bit newbie to this so help would be much much appreciated

If any information is missing, just ask and I will give the info (but please, I am a newbie, so let me know how to get the info with the command line)

here are the content of usr/local/

empereur@empereur-Sky-X4C ~ $ ls /usr/local/ bin cuda
cuda-9.1 games lib sbin src Brother cuda-9.0 etc
include man share

here are the content of usr/local/cuda/lib64 libaccinj64.so

empereur@empereur-Sky-X4C ~ $ ls /usr/local/cuda/lib64 libaccinj64.so libcusparse.so.9.1.85 libnppist.so.9.1.85 libaccinj64.so.9.1
libcusparse_static.a libnppist_static.a libaccinj64.so.9.1.85 libnppc.so libnppisu.so libcublas_device.a
libnppc.so.9.1 libnppisu.so.9.1 libcublas.so
libnppc.so.9.1.85 libnppisu.so.9.1.85 libcublas.so.9.1
libnppc_static.a libnppisu_static.a libcublas.so.9.1.128
libnppial.so libnppitc.so libcublas.so.9.1.85
libnppial.so.9.1 libnppitc.so.9.1 libcublas_static.a
libnppial.so.9.1.85 libnppitc.so.9.1.85 libcudadevrt.a
libnppial_static.a libnppitc_static.a libcudart.so
libnppicc.so libnpps.so libcudart.so.9.1
libnppicc.so.9.1 libnpps.so.9.1 libcudart.so.9.1.85
libnppicc.so.9.1.85 libnpps.so.9.1.85 libcudart_static.a
libnppicc_static.a libnpps_static.a libcufft.so
libnppicom.so libnvblas.so libcufft.so.9.1
libnppicom.so.9.1 libnvblas.so.9.1 libcufft.so.9.1.85
libnppicom.so.9.1.85 libnvblas.so.9.1.128 libcufft_static.a
libnppicom_static.a libnvblas.so.9.1.85 libcufftw.so
libnppidei.so libnvgraph.so libcufftw.so.9.1
libnppidei.so.9.1 libnvgraph.so.9.1 libcufftw.so.9.1.85
libnppidei.so.9.1.85 libnvgraph.so.9.1.85 libcufftw_static.a
libnppidei_static.a libnvgraph_static.a libcuinj64.so
libnppif.so libnvrtc-builtins.so libcuinj64.so.9.1
libnppif.so.9.1 libnvrtc-builtins.so.9.1 libcuinj64.so.9.1.85
libnppif.so.9.1.85 libnvrtc-builtins.so.9.1.85 libculibos.a
libnppif_static.a libnvrtc.so libcurand.so libnppig.so libnvrtc.so.9.1 libcurand.so.9.1 libnppig.so.9.1
libnvrtc.so.9.1.85 libcurand.so.9.1.85 libnppig.so.9.1.85
libnvToolsExt.so libcurand_static.a libnppig_static.a
libnvToolsExt.so.1 libcusolver.so libnppim.so
libnvToolsExt.so.1.0.0 libcusolver.so.9.1 libnppim.so.9.1
libOpenCL.so libcusolver.so.9.1.85 libnppim.so.9.1.85
libOpenCL.so.1 libcusolver_static.a libnppim_static.a
libOpenCL.so.1.0 libcusparse.so libnppist.so
libOpenCL.so.1.0.0 libcusparse.so.9.1 libnppist.so.9.1 stubs


Solution

  • Thanks to all for the help, so i accidentaly installed cuda 9.1 (9.0 is needed). I did that while not specificly forcing the version on cuda-toolkits. Solved my problem (improperly) by purging cuda 9.1 and nvidia-cuda-toolkit and reinstalling the 9.0 version. Could probably have solve it a more clean way by following the suggestion of laylog

    But instead of purging 9.1, you can point the cuda symlink to point to CUDA-9.0 or update the LD_LIBRARY_PATH in your bashrc to point to CUDA-9.0

    Thanks again all!