良许Linux教程网 干货合集 Linux系统安装TensorFlow详细步骤

Linux系统安装TensorFlow详细步骤

借助 TensorFlow,初学者和专家可以轻松创建适用于桌面、移动、网络和云端环境的机器学习模型。下面良许教程网为大家分享一下Linux系统安装TensorFlow的详细步骤,有需要的朋友可以参考一下。

Linux系统安装TensorFlow详细步骤

TensorFlow简介;

  • TensorFlow是一个开放源代码软件库,用于进行高性能数值计算。

  • 借助其灵活的架构,用户可以轻松地将计算工作部署到多种平台(CPU、GPU、TPU)和设备(桌面设备、服务器集群、移动设备、边缘设备等)。

  • TensorFlow 是一个用于研究和生产的开放源代码机器学习库。

  • TensorFlow 提供了各种 API,可供初学者和专家在桌面、移动、网络和云端环境下进行开发。

环境准备

下载anaconda, https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh

安装

 [root@localhost ~]# wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
 [root@localhost ~]#  bash Anaconda3-2019.10-Linux-x86_64.sh
 12

以上信息提示,都进行按ENTER,输入yes操作。

配置jupyter环境

 [root@localhost ~]#   source /root/.bashrc
 1

查看conda版本

 [root@localhost ~]#   conda --version
 1

配置jupyter notebook

 [root@localhost ~]#    cd /root/anaconda3/etc/jupyter
 (base) [root@localhost jupyter]#   jupyter notebook --generate-config
 12

设置置jupyter notebook的登录密码

  (base) [root@localhost data]# python
 Python 3.7.4 (default, Aug 13 2019, 20:35:49)
 [GCC 7.3.0] :: Anaconda, Inc. on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from notebook.auth import passwd
 >>> passwd()
 Enter password:
 Verify password:
 'sha1:fc48ba43d994:264211bcd15748509d8711bfede4ae330d208641'
 >>> exit()
 
  'sha1:fc48ba43d994:264211bcd15748509d8711bfede4ae330d208641'密码后续需要。
 123456789101112

修改jupyter notebook的文件设置

 (base) [root@localhost data]#  cd /root/.jupyter/
 (base) [root@localhost .jupyter]#  ls
 (base) [root@localhost .jupyter]# vim jupyter_notebook_config.py
 123

修改登录配置

 c.NotebookApp.ip = 'ip'  # 允许访问此服务器的 IP,星号表示任意 IP
 c.NotebookApp.password = u'sha1:fc48ba43d994:264211bcd15748509d8711bfede4ae330d208641' # 之前生成的密码字串
 c.NotebookApp.open_browser = False # 运行时不打开本机浏览器
 c.NotebookApp.port = 8888 # 使用的端口
 c.NotebookApp.enable_mathjax = True # 启用 MathJax
 c.NotebookApp.notebook_dir = '/root/jupyter'      # 存放文件的目录
 c.NotebookApp.allow_remote_access = True     # 允许远程访问
 1234567

启动 jupyter notebook

 jupyter notebook --allow-root
 1

开启linux防火墙,运行远程访问

查看防火墙状态

 (base) [root@localhost ~]#systemctl status firewalld.service  #查看防火墙状态
 (base) [root@localhost ~]#systemctl stop firewalld.service   #关闭运行的防火墙
 (base) [root@localhost ~]#systemctl status firewalld.service  #查看防火墙状态可以看到
 123

使用ip和设置的密码进行登录

jupyter安装tensorflow

登录jupyter后pip安装

 pip install keras tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --default-timeout=100
 1

在这里插入图片描述以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你!

137e00002230ad9f26e78-265x300

本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部