UNBUTU Installing and compiling MatConvNet



Installing and compiling the library

In order to install the library, follows these steps:

  1. Download and unpack the library source code into a directory of your choice. Call the path to this directory <MatConvNet>.
  2. Compile the library.

At this point the library is ready to use. You can test it by using the command (using MATLAB R2014a or later):

Compiling

MatConvNet compiles under Linux, Mac, and Windows. This page discusses compiling MatConvNet using the MATLAB function vl_compilenn. While this is the easiest method, the command line or an IDE can be used as well.unbuntu使用gcc编译器就可以了

Compiling for CPU

If this is the first time you compile MatConvNet, consider trying first the CPU version. In order to do this, use the vl_compilenn command supplied with the library:

  1. Make sure that MATLAB is configured to use your compiler.
  2. Open MATLAB and issue the commands:
    > cd <MatConvNet>
    > addpath matlab  
    > vl_compilenn
    

At this point MatConvNet should start compiling. If all goes well, you are ready to use the library. If not, you can try debugging the problem by running the compilation script again in verbose mode:

> vl_compilenn('verbose', 1)

Increase the verbosity level to 2 to get even more information.

Remark: The 'vl_imreadjpeg' tool uses an external image library to load images. In Mac OS X and Windows, the default is to use the system libraries (Quartz and GDI+ respectively), so this dependency is immaterial. In Linux, this tool requires the LibJPEG library and the corresponding development files to be installed in the system. If needed, the ImageLibraryCompileFlags and ImageLibraryLinkFlags options can be used to adjust the compiler and linker flags to match a specific library installation. It is also possible to use the EnableImreadJpeg option of vl_compilenn to turn off this feature.

大部分情况下是需要使用GPU编译的,比如CVPR2016中MDNet(Multi-Domain Convolutional Neural Networks )的安装使用

Compiling the GPU support

To use the GPU-accelerated version of the library, you will need a NVIDA GPU card with compute capability 2.0 or greater and a copy of the NVIDIA CUDA toolkit. Ideally, the version of the CUDA toolkit should match your MATLAB version:

MATLABCUDA toolkit
R2013b5.5
R2014a5.5
R2014b6.0
R2015a6.5
R2015b7.0

You can also use the gpuDevice MATLAB command to find out MATLAB's version of the CUDA toolkit. It is also possible (and often necessary) to use a more recent version of CUDA than the one officially supported by MATLAB; this is explained later.

Assuming that there is only a single copy of the CUDA toolkit installed in your system and that it matches MATLAB's version, compile the library with:

> vl_compilenn('enableGpu', true)

If you have multiple versions of the CUDA toolkit, or if the script cannot find the toolkit for any reason, specify the path to the CUDA toolkit explicitly. For example, on a Mac this may look like:

有时编译会出现找不到CUDA的情况,这时候也可以打开vl_compilenn.m文件去修改CUDA的路径到目前CUDA在系统中的安装路径

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

Once more, you can use the verbose option to obtain more information if needed.

last

Start MATLAB and type:

> run <MatConvNet>/matlab/vl_setupnn

in order to add MatConvNet to MATLAB's search path.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值