Linux系统如何安装TensorFlow

发布时间:2022-01-24 11:03:03 作者:小新
来源:亿速云 阅读:158

这篇文章主要介绍Linux系统如何安装TensorFlow,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

TensorFlow简介;

环境准备

下载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系统如何安装TensorFlow

以上是“Linux系统如何安装TensorFlow”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

推荐阅读:
  1. 如何安装多个版本的TensorFlow
  2. Tensorflow pip安装的方法

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

linux tensorflow

上一篇:如何进行FirewallD 防火墙的使用

下一篇:Linux系统中怎么安装wine

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》