tensorflow gpu 安装(附百度云下载安装文件)ubuntu 14.04 64bit + tensosrflow gpu + cuda +cudnn +python 2.7
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow
免费下载资源
·
满满的血泪史啊,安装下载了两天,tensorflow终于跑起来了。
ubuntu 14.04 64bit + tensosrflow gpu + cuda +cudnn +python 2.7
官网大意是:
1.可去navidia官网查看自己的显卡是否支持GPU
本人的显卡在列表中。
2.安装cuda
Download and install Cuda Toolkit
https://developer.nvidia.com/cuda-downloads
Install version 7.5 if using our binary releases. 看清楚是7.5的版本,最初一不小心装了8.0的版本,安装下载了第一遍各种不正常,再次翻看官网教程才看到tensorflow要的是7.5的版本。
本人百度云下载:
$ sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
$sudo apt-get update
$ sudo apt-get install cuda
3.安装cudnn
文件下载:
$tar xvzf cudnn-7.5-linux-x64-v5.1-ga.tgz
$sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
4.安装tensorflow
github上下载whl文件
http://pan.baidu.com/s/1pLaWVdL
$ sudo apt-get install python-pip python-dev
$sudo pip install --upgrade tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl
5. 配置环境
$gedit ~/.bashrc &
在文件尾部添加两行:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
保存退出.
$source ~/.bashrc
6. 错误处理
$python
fky@ubuntu:/usr/local$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
..........
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
>>>
报错了,运行如下命令
$ sudo pip install --upgrade distribute
重试:
fky@ubuntu:/usr/local$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] Couldn't open CUDA library libcudnn.so. LD_LIBRARY_PATH: :/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
I tensorflow/stream_executor/cuda/cuda_dnn.cc:3448] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
>>> import tensorflow as tf
>>> import numpy as np
>>> x_data = np.random.rand(100).astype(np.float32)
>>> y_data = x_data * 0.1 + 0.3
>>> W = tf.Variable(tf.random_uniform([1], -1.0, 1.0))
>>> b = tf.Variable(tf.zeros([1]))
>>> y = W * x_data + b
>>> loss = tf.reduce_mean(tf.square(y - y_data))
>>> optimizer = tf.train.GradientDescentOptimizer(0.5)
>>> train = optimizer.minimize(loss)
>>>
好了,万事大吉。
后附全部的百度云链接:
百度云安装资料
http://pan.baidu.com/s/1eR2dvHK
GitHub 加速计划 / te / tensorflow
184.55 K
74.12 K
下载
一个面向所有人的开源机器学习框架
最近提交(Master分支:2 个月前 )
a49e66f2
PiperOrigin-RevId: 663726708
2 个月前
91dac11a
This test overrides disabled_backends, dropping the default
value in the process.
PiperOrigin-RevId: 663711155
2 个月前
更多推荐
已为社区贡献8条内容
所有评论(0)