我的环境如下:windows10,matlab2014a
在配置完MATLAB的接口之后,可以运行MATLAB自带的测试程序:
[scores, maxlabel] = classification_demo(im, use_gpu)
然后我准备了mnist例程的相关文件,如下:
deploy.prototxt和lenet_iter_10000.caffemodel
我试图输入一张图片,然后运行得到分类结果,但运行的结果是matlab卡死,程序自动退出,不知道哪里出了问题,代码如下:
if exist('../+caffe', 'dir')
addpath('..');
else
error('Please run this demo from caffe/matlab/demo');
end
% Set caffe mode
if exist('use_gpu', 'var') && use_gpu
caffe.set_mode_gpu();
gpu_id = 0; % we will use the first gpu in this demo
caffe.set_device(gpu_id);
else
caffe.set_mode_cpu();
end
% Initialize the network using BVLC CaffeNet for image classification
% Weights (parameter) file needs to be downloaded from Model Zoo.
model_dir = '../../models/mnist/';
net_model = [model_dir 'deploy.prototxt'];
net_weights = [model_dir 'lenet_iter_10000.caffemodel'];
phase = 'test'; % run with phase test (so that dropout isn't applied)
if ~exist(net_weights, 'file')
error('Please download CaffeNet from Model Zoo before you run this demo');
end
% Initialize a network
net = caffe.Net(net_model, net_weights, phase);
每次都是运行到net = caffe.Net(net_model, net_weights, phase);就卡死 了
高手请指教