? Ubuntu 18.04bet356手机版现金_博彩bet356安卓下载_bet356充值Tensorflow(CPU)_Linux教程_Linux公社-Linux系统门户网站 bet356手机版现金_博彩bet356安卓下载_bet356充值
手机版
你好,游客 登录 注册
背景:
阅读新闻

Ubuntu 18.04bet356手机版现金_博彩bet356安卓下载_bet356充值Tensorflow(CPU)

[日期:2019-06-02] 来源:Linux公社? 作者:Linux [字体: ]

最近我开始学习深度学习框架Tensorflow,一开始在Windows平台下的anaconda下bet356手机版现金_博彩bet356安卓下载_bet356充值,由于anacondabet356手机版现金_博彩bet356安卓下载_bet356充值几次后navigator打开老是出现闪退的问题,所以决定换个Ubuntu下继续折腾tensorflow。本人笔记本没有NVIDIA显卡,只装的CPU版本的。而且是在虚拟机下的,下面开始吧。

先bet356手机版现金_博彩bet356安卓下载_bet356充值好Ubuntu 18.04版本的系统(最好是Ubuntu的14.04版本以上),Ubuntu系统已经有了了Python 3.7.7.7,所以不需要再bet356手机版现金_博彩bet356安卓下载_bet356充值Python了。

一、首先更新源为阿里云软件源,增加下载速度

(1)备份当前也就是默认官方的源列表

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

(2)删除sources.list文件中的列表,删除全部内容

sudo gedit /etc/apt/sources.list1

(3)替换内容后,保存

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

4)更新源列表

sudo apt-get update

参考:https://www.linuxidc.com/Linux/2019-04/158157.htm

二、bet356手机版现金_博彩bet356安卓下载_bet356充值Tensorflow(Python3.6.7/CPU)

(1)bet356手机版现金_博彩bet356安卓下载_bet356充值Python3的包管理pip

sudo apt-get install python3-pip python3-dev

Ubuntu 18.04bet356手机版现金_博彩bet356安卓下载_bet356充值Tensorflow(CPU)

(2)bet356手机版现金_博彩bet356安卓下载_bet356充值tensorflow

(自动bet356手机版现金_博彩bet356安卓下载_bet356充值相关库numpy、tensorboard、six、protobuf、html5lib、bleach、werkzeug、markdown)

linuxidc@linuxidc:~/linuxidc.com$?sudo pip3 install tensorflow

Ubuntu 18.04bet356手机版现金_博彩bet356安卓下载_bet356充值Tensorflow(CPU)

(3)测试tensorflow

linuxidc@linuxidc:~/linuxidc.com$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> a = tf.constant(1)
>>> b = tf.constant(2)
>>> op = a + b
>>> sess = tf.Session()
2019-06-02 06:35:29.407386: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-06-02 06:35:29.427402: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 1799995000 Hz
2019-06-02 06:35:29.427627: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x24f1710 executing computations on platform Host. Devices:
2019-06-02 06:35:29.427675: I tensorflow/compiler/xla/service/service.cc:158]? StreamExecutor device (0): ,
>>> sess.run(op)
3
>>> sess.close()
>>>

Ubuntu 18.04bet356手机版现金_博彩bet356安卓下载_bet356充值Tensorflow(CPU)

更多Python相关信息见Python 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=17

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

本文永久更新链接地址https://www.linuxidc.com/Linux/2019-06/158934.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款