ubuntu14.04+GPU安装TensorFlow

主要是参照官方文档https://www.tensorflow.org/install/install_linux#gpu_support

也参考了网上一些博客,以前都需要安装源码,但是现在不需要了,操作很简单

因为之前机子装了caffe,所以cuda和cudnn都已经是现成的,版本:cuda8.0,cudnn5.0

$sudo apt-get install libcupti-dev

virtualenv安装

$sudo apt-get install python-py python-dev python-virtualenv

$virtualenv --system-site-packages ~/tensorflow
$source ~/tensorflow/bin/activate
$ (tensorflow)$pip install --upgrade tensorflow-gpu #用于Python 2.7和GPU

报错1:
Downloading/unpacking tensorflow-gpu
Could not find any downloads that satisfy the requirement tensorflow-gpu
Cleaning up...
No distributions at all found for tensorflow-gpu
Storing debug log for failure in /tmp/tmpmUPZAM

一般是由于pip版本过低所致,查看了以下pip版本号,
$pip --version


$pip install -U pip
$pip --version

$ pip install --upgrade tensorflow-gpu

看起来似乎是安装成功了
按照官网说明检测一下
报错2:
File "<stdin>", line 1
hello = tf.constant('Hello,TensorFlow!')
^
SyntaxError: invalid syntax
从官网复制的括号变成了中文的括号。。。。
修改了之后

按照成功。撒花~


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值