Ubuntu安装Tensorflow

由于我的ubuntu是最新版的(ubuntu-16.04-desktop-amd64),里面自带的python是2.7.11。因此满足要求。由于tensorflow有三种安装方式,这里采用的是pip安装方式。下面开始安装tensorflow:
本篇文章来源于 Linux公社网站(www.linuxidc.com) 原文链接:http://www.linuxidc.com/Linux/2016-05/131568.htm

  • 首先安装pip

    sudo apt-get install python-pip python-dev

  • 利用pip安装tensorflow

sudo pip install –upgrade

  • 检验tensorflow是否安装成功

通过下面一段代码来测试tensorflow是否安装成功:
$ python

 >>>  import tensorflow as tf
>>>  hello = tf.constant('Hello, TensorFlow!')
>>>  sess = tf.Session()
>>>  print(sess.run(hello))
Hello, TensorFlow!
>>>  a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
  • 安装python-numpy ,python-scipy,python-matplotlib

sudo apt-get install python-numpy

sudo apt-get install python-scipy

sudo apt-get install python-matplotlib

摘自:http://www.linuxidc.com/Linux/2016-05/131568.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值