日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu16.04+caffe+digits安装配置

發布時間:2024/9/21 Ubuntu 84 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu16.04+caffe+digits安装配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

注:本文主要介紹的是如何在ubuntu16.04系統下安裝caffe以及可視化工具digits,至于cuda和cudnn的安裝配置在我前一篇文章http://blog.csdn.net/cdwxx1234/article/details/75121562已經介紹了,此文不再重復。不多說了,我們開始吧!

一.必要依賴包安裝

[html] view plaincopy
  • sudo?apt-get?install?build-essential??
  • sudo?apt-get?install?--no-install-recommends?libboost-all-dev??
  • sudo?apt-get?install?libatlas-base-dev?libgflags-dev?libgoogle-glog-dev?liblmdb-dev??
  • sudo?apt-get?install?libprotobuf-dev?libleveldb-dev?libsnappy-dev?libopencv-dev?libhdf5-serial-dev?protobuf-compiler??
  • sudo?apt-get?install?libblas-dev?liblapack-dev?libatlas-base-dev?gfortran?python-numpy??
  • 二.安裝pip和easy-install

    [html] view plaincopy
  • cd??
  • wget?--no-check-certificate?https://bootstrap.pypa.io/ez_setup.py??
  • sudo?python?ez_setup.py?--insecure??
  • wget?https://bootstrap.pypa.io/get-pip.py??
  • sudo?python?get-pip.py??
  • 三.安裝caffepython依賴

    1).安裝git

    [html] view plaincopy
  • sudo?apt-get?install?git??
  • 2).獲取caffe源碼(可cd到指定文件夾下下載):

    [html] view plaincopy
  • git?clone?https://github.com/BVLC/caffe.git??
  • 3).在caffe根目錄python文件夾下安裝依賴項;

    [html] view plaincopy
  • sudo?apt-get?install?python-pip??
  • sudo?for?req?in?$(cat?"requirements.txt");?do?pip?install?-i?https://pypi.tuna.tsinghua.edu.cn/simple?$req;?done??
  • 四.編譯caffe

    打開終端

    [html] view plaincopy
  • cd?caffe??
  • sudo?cp?Makefile.config.example?Makefile.config??
  • sudo?gedit?Makefile.config??
  • 在打開的Makefile.config文件中做如下修改;

    1).將USE_CUDNN := 1取消注釋;

    2).INCLUDE_DIRS := $(PYTHON_INCLUDE)/usr/local/include空格后然后添加/usr/include/hdf5/serial?/usr/local/cuda-8.0/include/(添加cuda的include路徑);

    3).LIBRARY_DIRS:=$(PYTHON_LIB)/usr/local/lib?/usr/lib ? 空格后添加 /usr/local/cuda-8.0/lib64/(添加cuda的lib路徑);

    接著就開始編譯caffe

    [html] view plaincopy
  • make?all?–j16???(16線程,線程越多速度越快)??
  • make?test?–j16??
  • make?runtest?–j16??
  • make?pytest?–j16??
  • 一般在編譯make all 的時候可能會出錯,后面出錯的幾率不大。碰到的問題和解決方法與安裝目標檢測ssd遇到的一樣,具體參考http://blog.csdn.net/cdwxx1234/article/details/75136657。

    編譯成功后測試python?

    [html] view plaincopy
  • cd?caffe/python??
  • python???
  • import?caffe???
  • 沒有報錯,編譯就成功了。

    五.安裝digits

    digits是caffe的一個可視化工具,可使我們對caffe的操作變得方便容易。

    1).獲取digits安裝包

    [html] view plaincopy
  • sudo?git?clone?https://github.com/NVIDIA/DIGITS.git?digits??
  • 2).安裝digits及依賴項

    [html] view plaincopy
  • cd?digits??
  • sudo?apt-get?install?graphviz?gunicorn??
  • for?req?in?$(cat?requirements.txt);?do?sudopip?install?$req;?done???
  • 3).打開digits

    [html] view plaincopy
  • cd?digits??
  • ./digits-devserver??
  • 在網頁上輸入http://localhost:5000即可打開界面。

    4).遇到的問題

    在終端輸入./digits-devserver后出現如下錯誤:

    ValueError: Caffe executable not found inPATH


    解決方案:

    1).檢查當前envvar的值

    [html] view plaincopy
  • echo?$CAFFE_ROOT??
  • 2).把envvar加到~/.profile中,下次當你登錄時會自動加載
    [html] view plaincopy
  • echo?"export?CAFFE_ROOT=/home/username(我的賬戶名)/caffe/"?>>?~/.profile??
  • 3).加載新配置
    [html] view plaincopy
  • source?~/.profile??
  • 4).檢查新配置 [html] view plaincopy
  • echo?$CAFFE_ROOT??
  • /home/username/caffe/??
  • 按上面的方法改了之后,digits順利啟動。

    總結

    以上是生活随笔為你收集整理的Ubuntu16.04+caffe+digits安装配置的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。