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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

centos 安装 MatConvNet (gpu)

發布時間:2023/12/10 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos 安装 MatConvNet (gpu) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1. 安裝準備

  • ? matlab2017a ,參考:centos 安裝matlab2017a(無root權限)
  • ? GCC 4.8(支持c++11) ? ?? 鍵入:sudo yum install gcc gcc-c++ ? (建議sudo裝)
  • ? 至少CUDA 7.5,(本人選擇cuda8.0)
  • ? CuDNN v4 (與cuda8對應,選擇cudnn v5.0)
  • ? LibJPEG ? ? ? ? 鍵入:sudo yum install ? libjpeg-turbo-devel (建議sudo裝)
注意:直接使用以上命令安裝Libjpeg可能會出現找不到"jpeglib.h"的錯誤,這時需要運行: sudo yum -y install libjpeg* 這時可以檢查如下目錄,確認文件存在即可。


首先需要下載matconvenet,然后打開matlab進入到matconvnet-1.0-beta25/matlab
目錄下,即vl_compilenn的目錄下。

2. ?開始安裝

1). 先設置mex ,即: mex -setup mex -setup C++結果:
>> mex -setup MEX configured to use 'gcc' for C language compilation. Warning: The MATLAB C and Fortran API has changed to support MATLABvariables with more than 2^32-1 elements. You will be requiredto update your code to utilize the new API.You can find more information about this at:http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.To choose a different language, select one from the following:mex -setup C++ mex -setup FORTRAN MEX configured to use 'g++' for C++ language compilation. Warning: The MATLAB C and Fortran API has changed to support MATLABvariables with more than 2^32-1 elements. You will be requiredto update your code to utilize the new API.You can find more information about this at:http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html. >> 2).設置gpu支持
? ?為了增加gpu加速,你需要NVIDIA GPU,且運算能力在2.0以上 你也可以使用?gpuDevice在matlab中查找合適的cuda版本


顯然我的是cuda8.0.?
3).如果只裝了一個cuda,且匹配matlab的版本,此時可以運行如下命令編譯:
vl_compilenn('enableGpu', true)但如果裝了好幾個cuda,此時需要指定cuda的位置,即:

vl_compilenn('enableGpu', true, 'cudaRoot', '/Developer/NVIDIA/CUDA-8.0')

4).編譯cuDNN支持
  • ?一般編譯:
> vl_compilenn
  • 使用CUDA編譯:?
vl_compilenn('enableGpu', true)
  • 使用cudnn編譯(路徑名需要根據實際情況設置):
vl_compilenn('enableGpu', true, ...'cudaMethod', 'nvcc', ...'cudaRoot', '/usr/local/cuda/', ...'enableCudnn', true, ...'cudnnRoot', '/usr/local/cuda') 注意:以上命令進入matlab中執行。需要先進入matlab目錄下,然后執行vl_compilenn。

3. 測試

進入到xtest目錄下,執行 vl_testnn 如果測試gpu支持的話,執行: vl_testnn('gpu', true)

運行結束,會有一個總結,如果沒有錯誤實例,則表明安裝成功。?



補充說明:

如果要在matlab指定使用gpu的話,可以提前使用gpuDevice ,參考:https://cn.mathworks.com/help/distcomp/gpudevice.html


4. 參考文獻

  • MatConvNet在Ubuntu14.04上的配置筆記
  • jpeglib.h: No such file or directory - CentOS 7
  • windows下編譯Matconvnet的方法(CPU和GPU)
  • gpuDevice設置
  • Matconvnet官網



  • 總結

    以上是生活随笔為你收集整理的centos 安装 MatConvNet (gpu)的全部內容,希望文章能夠幫你解決所遇到的問題。

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