tensorflow安装记录

环境:

win7+vmware

Ubuntu 16.04.3 LTS

Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.


正确的安装姿势:

sudo apt-get install python-pip python-dev

很顺利,但是需要更新pip到最新版本.

pip install --upgrade pip

由于国内到国外有大墙(我司有用搬瓦工服务器搭建的shadow vpn),就下载whl安装

安装文件分享出来:http://download.csdn.net/download/yx511500623/10152547


最后:

root@zsj-ubuntn:~# pip install  '/root/桌面/tensorflow-0.8.0-cp27-none-linux_x86_64.whl'
Processing ./??/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
Collecting numpy>=1.8.2 (from tensorflow==0.8.0)
  Downloading numpy-1.13.3-cp27-cp27mu-manylinux1_x86_64.whl (16.6MB)
    100% |████████████████████████████████| 16.7MB 8.3kB/s
Collecting six>=1.10.0 (from tensorflow==0.8.0)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting protobuf==3.0.0b2 (from tensorflow==0.8.0)
  Downloading protobuf-3.0.0b2-py2.py3-none-any.whl (326kB)
    100% |████████████████████████████████| 327kB 40kB/s
Requirement already satisfied: wheel in /usr/lib/python2.7/dist-packages (from tensorflow==0.8.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from protobuf==3.0.0b2->tensorflow==0.8.0)
Installing collected packages: numpy, six, protobuf, tensorflow
Successfully installed numpy-1.13.3 protobuf-3.0.0b2 six-1.11.0 tensorflow-0.8.0
root@zsj-ubuntn:~#

用tensorflow输出hello world

oot@zsj-ubuntn:~# python
Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello =tf.constant(´Hello TensorFlow!
  File "<stdin>", line 1
    hello =tf.constant(´Hello TensorFlow!
                       ^
SyntaxError: invalid syntax
>>> hello =tf.constant(´Hello TensorFlow!´)
  File "<stdin>", line 1
    hello =tf.constant(´Hello TensorFlow!´)
                       ^
SyntaxError: invalid syntax
>>> hello =tf.constant(´Hello TensorFlow!´)
  File "<stdin>", line 1
    hello =tf.constant(´Hello TensorFlow!´)
                       ^
SyntaxError: invalid syntax
>>>
>>> hello =tf.constant('Hello TensorFlow!')
>>> sess=tf.Session()
>>> print sess.rum(hello)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Session' object has no attribute 'rum'
>>> print sess.run(hello)
Hello TensorFlow!
>>> a=ft.constant(10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'ft' is not defined
>>> a=tf.constant(10)
>>> b=tf.constant(32)
>>> print sess.run(a+b)
42
>>>


折腾了2个晚上才搞定,本来用的centos6 后来下载的ubuntu iso重新安装














  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值