1. 程式人生 > >**ubuntu 14.04 安裝好後關於深度學習的一些簡單操作*

**ubuntu 14.04 安裝好後關於深度學習的一些簡單操作*

1.換原 sudo vim /etc/apt/sources.list #修改原 如果沒有vim,可以使用gedit編輯器來修改原 sudo gedit /etc/apt/sources.list 內容替換如下(選用阿里原): deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/

trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src
http://mirrors.aliyun.com/ubuntu/
trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 儲存退出後,執行以下命令來更新原: sudo apt-get update sudo apt-get upgrade 結束後重啟ubuntu系統。

2.安裝python環境中的pip apt-get install python-pip#安裝pip python -m pip install --upgrade pip#升級pip

3安裝opencv——原始碼方式安裝 安裝opencv的依賴包: sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libtiff4-dev libswscale-dev libjasper-dev

從官網下載opencv-2.4.9: https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download unzip opencv.zip cd opencv-2.4.9/ mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local … make -j4 make install

4.安裝tensorflow CPU 本地檔案安裝 pip install tensorflow_gpu-1.8.0-cp27-none-linux_x86_64.whl 進入python測試 import tensorflow 測試成功