零基础入门Tensorflow-001-安装

Ubuntu下本人亲测有效

  1. 下载 Anaconda
    链接:http://pan.baidu.com/s/1c7Zkcu 密码:ca9b
  2. 命令及注释
# 安装 Anaconda
bash Anaconda3-4.3.0-Linux-x86_64.sh
# 创建一个 conda 环境,名称为 tf
conda create -n tf -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# To activate this environment
source activate tf
# 在 conda 环境 tf 中,安装 tensorflow 及其依赖
conda install -y -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ tensorflow
  1. 入门参考 (tensorflow 译文)
    https://pan.baidu.com/s/1dF5ld3j 密码: 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
>>>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容