折騰了一天后,原win8+Ubuntu雙系統(tǒng)安裝失敗:
主要問(wèn)題:Ubuntu安裝后,依然進(jìn)入win8,沒(méi)有Ubuntu的啟動(dòng)項(xiàng)
雙系統(tǒng)安裝教程:
http://tieba.baidu.com/p/3338405022?see_lz=1
http://tieba.baidu.com/p/3338849023?see_lz=1
改用vmware +Ubuntu虛擬機(jī)
軟件下載
vmvare 下載安裝:官網(wǎng)或者百度軟件站下載即可.
Ubuntu下載: Ubuntu 16.04.2 LTS (Xenial Xerus) 64-bit PC (AMD64) desktop image
http://mirror.pnl.gov/releases/xenial/
虛擬機(jī)安裝教程:
http://jingyan.baidu.com/article/acf728fd417687f8e410a35a.html
Ubuntu設(shè)置root密碼
默認(rèn)root密碼是隨機(jī)的,即每次開(kāi)機(jī)都有一個(gè)新的root密碼。我們可以在終端輸入命令 sudo passwd,然后輸入新的密碼,就能將root用戶密碼都改成新的.注意不能和個(gè)人用戶重復(fù).
修改成功后,輸入命令 su root,再輸入新的密碼就可以進(jìn)入root權(quán)限狀態(tài)
安裝vmware tools
不要用yum install perl安裝perl,因?yàn)閁buntu的默認(rèn)管理包工具是apt,不是yum.
1.1 進(jìn)入ubuntu系統(tǒng)后,點(diǎn)擊虛擬機(jī)上的【VM】->【install vmware tools】,回到桌面回看到一個(gè)vmware tools的 cdrom圖標(biāo)。
1.2 雙擊打開(kāi),復(fù)制“VNwareTools-8.8.0-471268.tar.gz”到桌面下。 右鍵解壓。
1.3 回到解壓后的目錄文件夾vmware_tools_distrib下,打開(kāi)終端
1.4 輸入“sudo ./vmware-install.pl”,輸入用戶密碼便可開(kāi)始安裝了?;蛘咄蟿?dòng)vmware-install.pl到終端
1.5 接下來(lái)N多的enter,N多的YES,自己慢慢按吧。--如果中間有要輸入什么文件夾名之類的,不要管,就一通enter就行.
1.6 直到你看到—the vmware team就可關(guān)閉窗口,然后重新啟動(dòng)就可以煥然一新了。
1.7 若還沒(méi)有全屏顯示,則將虛擬機(jī)的【View】->【Autosize】->【Autofit Guest】,【Autofit Window】都選上。即可實(shí)現(xiàn)全屏。
1.8 安裝vmware tools實(shí)現(xiàn)全屏后,即也實(shí)現(xiàn)了在主機(jī)(WIN7)和虛擬機(jī)VMware (ubuntu)間直接拖拽文件。
安裝Python環(huán)境
安裝開(kāi)發(fā)包
系統(tǒng)升級(jí)
sudo apt update
sudo apt upgrade
安裝 python 基礎(chǔ)開(kāi)發(fā)包
sudo apt install -y python-dev python-pip python-nose gcc g++ git gfortran vim
安裝運(yùn)算加速庫(kù)
sudo apt install -y libopenblas-dev liblapack-dev libatlas-base-dev
Keras 框架搭建
相關(guān)開(kāi)發(fā)包安裝
在終端中輸入:
sudo pip install -U --pre pip setuptools wheel
sudo pip install -U --pre numpy scipy matplotlib scikit-learn scikit-image
tensorflow安裝(Python2.7,純cpu加速版):
whl的地址: https://github.com/tensorflow/tensorflow
命令:
sudo pip install --upgrade https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0-cp27-none-linux_x86_64.whl
keras
sudo pip install -U --pre keras
驗(yàn)證
安裝完畢后,輸入 python,然后輸入:
import tensorflow
import keras
如果沒(méi)有任何提示,則表明安裝已經(jīng)成功

Keras 中 mnist 數(shù)據(jù)集測(cè)試
下載 Keras 開(kāi)發(fā)包
git clone https://github.com/fchollet/keras.git
cd keras/examples/
python mnist_mlp.py
程序無(wú)錯(cuò)進(jìn)行,至此, keras 安裝完成。

附錄
keras中文文檔
http://keras-cn.readthedocs.io/en/latest/getting_started/keras_linux/