搜索
您的当前位置:首页正文

零基础入门Tensorflow-001-安装

来源:二三娱乐

Ubuntu下本人亲测有效

  1. 下载 Anaconda
    链接: 密码:ca9b
  2. 命令及注释
# 安装 Anaconda
bash Anaconda3-4.3.0-Linux-x86_64.sh
# 创建一个 conda 环境,名称为 tf
conda create -n tf -c 
# To activate this environment
source activate tf
# 在 conda 环境 tf 中,安装 tensorflow 及其依赖
conda install -y -c  tensorflow
  1. 入门参考 (tensorflow 译文)
    密码: e2zt
# 书上的例子,很傻很简单
$ 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))
42
>>>

Top