Ubuntu15.04 + Matlab2014a + MatConvNet install and compile

MatConvNet is a MATLAB toolbox implementingConvolutional NeuralNetworks (CNNs) for computer vision applications. It is simple,efficient, and can run and learn state-of-the-art CNNs. Severalexample CNNs are included to classify and encode images.

1. Download MatConvNet

https://github.com/vlfeat/matconvnet

2. Make sure that MATLAB is configured to use your compiler.

3. Compiling the CPU support

Open MATLAB and issue the commands:

> cd <MatConvNet>
> addpath matlab
> vl_compilenn

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

> vl_compilenn('verbose', 1)
4. Compiling the GPU support


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

> vl_compilenn('enableGpu', true)
 

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

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

5. Examples

% setup MtConvNet in MATLAB
run matlab/vl_setupnn

% download a pre-trained CNN from the web
urlwrite('http://www.vlfeat.org/sandbox-matconvnet/models/imagenet-vgg-f.mat', ...
  'imagenet-vgg-f.mat') ;
net = load('imagenet-vgg-f.mat') ;

% obtain and preprocess an image
im = imread('peppers.png') ;
im_ = single(im) ; % note: 255 range
im_ = imresize(im_, net.normalization.imageSize(1:2)) ;
im_ = im_ - net.normalization.averageImage ;

% run the CNN
res = vl_simplenn(net, im_) ;

% show the classification result
scores = squeeze(gather(res(end).x)) ;
[bestScore, best] = max(scores) ;
figure(1) ; clf ; imagesc(im) ;
title(sprintf('%s (%d), score %.3f',...
net.classes.description{best}, best, bestScore)) ;


reference url:

http://www.vlfeat.org/matconvnet/mfiles/vl_compilenn/

http://www.vlfeat.org/matconvnet/install/

http://www.vlfeat.org/matconvnet/pretrained/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值