python3でtensorflowをインポートするのに問題があります:
>>> import tensorflow as tf
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_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: libcusolver.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 "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_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: libcusolver.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.
バージョン375にはこのバグがあるため、Nvidiaドライババージョン381.09ベータを使用しています: https://askubuntu.com/questions/896221/strange-artifacts-along-window-borders-after-waking-computer-from-sleep-mode?noredirect=1&lq=1
CUDA 8.0とcuDNN-v6.0をインストールしました:
rharish@rharish-GL552VW:~$ cd /usr/local
rharish@rharish-GL552VW:/usr/local$ ls
bin cuda etc include man share
computecpp cuda-8.0 games lib sbin src
また、libcusolver.so.8.0は/usr/local/cuda/lib64/に存在します:
libcusolver.so.8.0 in 'ls' 出力。
CUDA、cuDNNをアンインストール、再インストールし、ソースからtensorflowを構築しています。この問題は、Nvidiaドライバをバージョン381.09ベータにアップデートして以来発生しています。何か良い方法はないでしょうか?
解決策を見つけた:
nvidia-381、CUDA-8.0(runfileを使用)、cuDNN 6.0を再インストールしました。そして、.bashrcに以下を追加しました:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/
再インストールの必要はありません。nvidia-cuda-dev`をインストールします:
sudo apt install nvidia-cuda-dev
cuDNN(https://developer.nvidia.com/cudnn からダウンロード)をインストールし、
LD_LIBRARY_PATHをそれに合わせて(
cuda/lib64`に)設定する。
TensorflowバージョンとCUDAの間の非互換性のために、このエラーに直面しました。
このhttps://www.tensorflow.org/install/source#tested_build_configurationsのように互換性のない tensorflow_gpu-1.3.0
、 CUDA 9
、 cuDNN 7
がありました。
tensorflow_gpu-1.3.0
をアンインストールし、tensorflow_gpu-1.5.0
をインストールしましたが、問題なく動作しました。