|||
Q:
import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/linlin/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/linlin/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/linlin/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/linlin/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/linlin/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/linlin/anaconda2/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: libcudnn.so.5: 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.
A:
.bashrc does not cofigure successfully. Two-step solution:
Step 1: using "vim .bashrc" (remote open) or "gedit .bashrc" (local open) to open ".bashrc" file,
and add the three following sentences at the end of the file:
export CUDA_HOME="/usr/local/cuda"
export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${CUDA_HOME}/extras/CUPTI/lib64"
export PATH="${CUDA_HOME}/bin:$PATH"
Step 2: using "source .bashrc" to compile the cofiguration file
Step 3: updata TensorFlow again using the command of "pip install tensorflow==1.2"
Step 4: test the configuration using the command of "python -c 'import tensorflow as tf; print('TF version:', tf.__version__)' "
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-7-28 10:14
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社