Ubuntu 16.04 LTS安装TensorFlow(Anaconda 4.3.1)

来源:互联网 发布:c语言代码指令大全 编辑:程序博客网 时间:2024/05/21 09:20

Installing TensorFlow on Ubuntu【官方链接】
安装anconda的命令是:bash+空格+包名 等待安装完毕即可,这里的包是下载下来的离线包
Anaconda下载链接
这里写图片描述

Ubuntu 16.04 LTS操作系统镜像下载
这里写图片描述
Ubuntu 16.04 LTS镜像下载链接

【Ubuntu和Anconda安装好之后执行以下操作】

— 更换anconda源(国外经常被墙的,换为清华镜像站)

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes  

— 创建环境(linux的tensorflow需要python3.6)

conda create -n tensorflow python=3.6.0  

— 进入环境

source activate tensorflow 

— 安装tensorflow

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp36-cp36m-linux_x86_64.whl  

— 检验安装是否成功

python  >>> import tensorflow as tf>>> hello = tf.constant('Hello, TensorFlow!')>>> sess = tf.Session()>>> print(sess.run(hello))
0 0
原创粉丝点击