您的位置:首页 > 其它

UNBUTU Installing and compiling MatConvNet

2016-07-08 15:30 393 查看


Installing and compiling the library

In order to install the library, follows these steps:

Download and unpack the library source code into a directory of your choice. Call the path to this directory
<MatConvNet>
.
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:

Make sure that MATLAB is
configured to use your compiler.
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息