gll89的个人博客分享 http://blog.sciencenet.cn/u/gll89

博文

TensorFlow configure problem

已有 3173 次阅读 2017-10-10 23:50 |个人分类:DeepLearning|系统分类:科研笔记| Configuration

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__)' "

           

           




https://blog.sciencenet.cn/blog-1969089-1080075.html

上一篇:Ubuntu install apt-get
下一篇:Embedding layers in Keras
收藏 IP: 128.227.53.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-7-28 10:14

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部