深度学习(四)环境配置 Ubuntu Server 16.04.1 LTS 安装步骤 tensorflow 安装
2016-09-03 22:31
671 查看
Ubuntu Server 16.04.1 LTS 安装步骤
1.下载ISO光盘镜像文件 http://www.ubuntu.com/download/server2.点击下载后进入http://www.ubuntu.com/download/server/install-ubuntu-server页面,有安装教程 https://help.ubuntu.com/lts/serverguide/index.html?_ga=1.11920567.202013523.1472813693 这里是服务指南,可以看很多信息
3.u盘制作安装盘http://jingyan.baidu.com/article/d3b74d64aa4a6a1f77e60932.html
4.网络上的安装教程http://www.upantool.com/sense/2014/4679_4.html 参考着安装即可,很多选项都可以选择自动的。
有一个重要的地方是在分区步骤的时候,一定要确定好选择哪个方式,选择好了就一步到底就行。如果中途停止了,自己又不知道怎么分区,就得重来了。
5.安装的过程中可以选择安装一些软件如postgres、mysql+php、open ssh,按空格选择,回车确定。
6.安装完成以后是网络设置,一般服务器时静态ip,因此ip设置形如如下即可:
=================================第一部分======================================
以下是对其中一个端口进行设置: 修改该文件的命令如 sudo vi /etc/network/interfaces
auto eth0 第0个端口
iface etho inet static 设置静态端口
address 172.16.22.91 //ip地址
gateway 172.16.0.2 网关
nameservers 172.16.0.2 //在虚拟机中尝试数次,某次成功后是这样设置的,因此就保留了
注意:::::eth0或者ens1这些名字是系统里定义好的,不能随便起,但是可以通过命令知道这些名字都有哪些:对应命令为: ifconfig -a 。 不能完成跟网络上的教程一样命名哦!
=================================第二部分==========================================
以下设置dns,没有设置dns不能解析域名
修改文件命令如下:sudo vi /etc/resolv.conf 参考资料:http://jingyan.baidu.com/article/4d58d54137d2a19dd5e9c050.html
nameserver 8.8.8.8 可以最多添加三个dns服务器,形式都是这样的
nameserver 9.9.9.9
以上便是相关的设置。
========================网络设置要有很多注意点,如下==========================================
虚拟机中:选择物理桥接 http://www.cnblogs.com/gylei/archive/2011/12/10/2283484.html
服务器机器的话:服务器有很多网线端口,确定网线端口选择正确,dell服务器有个IDRAC端口,我接错了,导致很长时间都不知道为啥上不了网
https://help.ubuntu.com/lts/serverguide/network-configuration.html 官方指南的网络配置,这里选择一些比较有趣的命令出来
sudo apt install ethtool
sudo ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on Supports Wake-on: g Wake-on: d Current message level: 0x000000ff (255) Link detected: yes
安装上面的命令执行,就能知道对应端口的状态::Link detected: yes 才是能够联通的状态,如果为no,请检查网线,网络配置。
哦:网络重启的命令是
/etc/ini.d/network restart 或者 stop 或者 start 多来几次,就能重启网卡了,如果还不行就exit退出,再进入,可能就好了。
7.完成以上步骤,可以选择安装桌面了
sudo apt-get update 更新源
安装桌面的方法:http://blog.csdn.net/firenet1/article/details/52421396 本人安装的是ubuntu-desktop
安装完成以后组合键 ctrl+alt + F7即可进入桌面环境,或者重启即可 这个组合键从F1-F6运行有6个窗口进行操作哦。非常有趣的
tensorflow 安装
https://github.com/jikexueyuanwiki/tensorflow-zh/blob/master/SOURCE/get_started/os_setup.md tensorflow的安装教程由于安装完ubuntu桌面,好多东西都有了,也就不知道是不是也装了一些tensorflow需要依赖的东西。
但是这个版本的ubuntu已经自带了python2.7,自己尝试装3.4失败了。幸好虚拟机有一个备份,于是直接采用2.7了
在安装前需要安装pip,使用命令
sudo apt-get install python-pip
这样得到的版本可能是8.1.1,如果直接用教程的命令,会不行,有以下提示
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
因此需要神级使用命令 pip install --upgrade pip
用pip --version 就能查看pip的版本如果8.1.2就ok,
然后运行命令:
# Ubuntu/Linux 64-bit, CPU only, Python 2.7: $ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl[/code] 最后跑一下测试代码:$ 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 >>>第一个tensorflow例子:
/usr/local/lib/python2.7/dist-packages/tensorflow 这是默认的tensorflow的安装目录
如果不对可以用以下命令找到对应的目录: sudo find / -name tensorflow ======也有可能必须使用root权限才行。用 su root 进入root账户
然后安装安装教程走即可从源代码树的根路径执行:
训练你的第一个 TensorFlow 神经网络模型$ cd tensorflow/models/image/mnist $ python convolutional.py Succesfully downloaded train-images-idx3-ubyte.gz 9912422 bytes. Succesfully downloaded train-labels-idx1-ubyte.gz 28881 bytes. Succesfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes. Succesfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes. Extracting data/train-images-idx3-ubyte.gz Extracting data/train-labels-idx1-ubyte.gz Extracting data/t10k-images-idx3-ubyte.gz Extracting data/t10k-labels-idx1-ubyte.gz Initialized! Epoch 0.00 Minibatch loss: 12.054, learning rate: 0.010000 Minibatch error: 90.6% Validation error: 84.6% Epoch 0.12 Minibatch loss: 3.285, learning rate: 0.010000 Minibatch error: 6.2% Validation error: 7.0% ... ...===补充linux让用户有权使用sudo su root 启动root 账号
http://bbs.csdn.net/topics/370199343 visudo按键操作
http://www.cnblogs.com/howDo/archive/2013/04/07/sudo-su.html 加入权限
首先使用root账号,使用visudo /etc/sudoers编辑
/etc/sudoers文件:
使用visodu命令后,打开的窗口与vi界面一致,如果想要为账号增加使用sudo命令的话,可以在 root ALL=(ALL) ALL这行后面加上如下内容:
# 用户账号 登录的主机 = (可以变换的身份) 可以执行的命令
username ALL=(ALL) ALL
刚才介绍的是用户身份的声明,下面还有一个特殊的用户组说明——wheel有如下内容:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
## Same thing without a password
## 用户在使用sudo命令时不用输入密码,后面的ALL可以换为具体的shell命令
# %wheel ALL=(ALL) NOPASSWD: ALL
选择以上一种方式修改文件、在文件的最后面
使用control+O写入
使用control+X退出
相关文章推荐
- Linux环境下(Ubuntu 16.04.1 LTS),Tomcat和Jenkins的安装和配置
- Ubuntu 16.04.1 Server 64bit 系统安装后的网络配置(Vmware Workstation 12.5 & Windows 10 X64 环境)
- Ubuntu环境下配置网络环境及ssh服务器搭建(openssh-server无法安装的终极解决方案)
- 在Ubuntu Server上源码安装OpenERP 8.0,并配置wsgi和nginx运行环境
- Ubuntu Server 16.04.1 安装配置以及简单使用MySQL(云服务器配置)
- Ubuntu环境下Anaconda安装TensorFlow并配置Jupyter远程访问
- TensorFlow的安装以及环境配置(ubuntu16.04+1070+Anaconda)
- UbuntuServer最小化安装gnome环境配置vnc4server
- ubuntu-14.04-server配置Jexus --安装步骤记录
- Ubuntu16.04 LTS配置caffe、tensorflow和theano环境
- ubuntu14.04下tensorflow环境配置(tensorflow0.12多种安装方式+cuda7.5升级8.0)
- Ubuntu 16.04 LTS, 64bit,cuda 8, Caffe环境配置编译和安装
- ubuntu14.04 lts server安装配置备忘
- 在Ubuntu Server上源码安装OpenERP 8.0,并配置wsgi和nginx运行环境
- Ubuntu Server 14.04.3 LTS 安装C/C++开发环境时遇到的依赖关系问题
- Ubuntu 16.04 LTS下安装配置Java环境
- Ubuntu环境下Hadoop的安装与配置步骤
- Ubuntu Server 12.04安装桌面环境以及配置VNC
- 在Ubuntu Server上源码安装OpenERP(odoo) 8.0,并配置wsgi和nginx运行环境