错误1:Traceback (most recent call last):
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/lwc/anaconda3/lib/python3.6/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/lwc/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/lwc/anaconda3/lib/python3.6/imp.py", line 343, 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 "/home/lwc/PycharmProjects/pythonTest1/Funct.py", line 5, in
import tensorflow as tf
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in
from tensorflow.python import *
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/lwc/anaconda3/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/lwc/anaconda3/lib/python3.6/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/lwc/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/lwc/anaconda3/lib/python3.6/imp.py", line 343, 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.
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.
错误原因:tensorflow-gpu版本与cuda不兼容,安的是cuda8.0 cudnn7,tensorflow-gpu 1.6.0.
实际上,tensorflow-gpu的1.4.0支持cuda8.0,而1.5.0及其以上版本,支持cuda9.0.
解决办法:卸载1.6.0: pip uninstall tensorflow-gpu==1.6.0
安装1.4.0:pip install tensorflow-gpu==1.4.0
错误2:ImportError: cannot import name 'abs'
错误原因:同时安装了cpu和gpu版本的tensorflow,cpu版本是1.13.0,gpu版本是1.4.0;
解决办法:卸载cpu版本。
错误3:ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory
错误原因:安装 的tensorflow-gpu 1.4.0对应cudnn6.0,而我安装的是cudnn7.0
解决办法:卸载1.4.0,重新安装1.11.0