vlfeat / matconvnet

MatConvNet: CNNs for MATLAB
Other
1.4k stars 753 forks source link

Attempt to execute SCRIPT vl_nnconv as a function Error #1180

Closed Automatik closed 6 years ago

Automatik commented 6 years ago

I already saw there are issues opened about this but I couldn't fix it. I have compiled with the commands

> cd D:\Program Files\MATLAB\R2018a\toolbox\MatConvNet_Vlfeat_Toolbox\matconvnet-1.0-beta25
> addpath matlab
> vl_compilenn

And I have run > vl_testnn and everything worked great.

Now I'm trying to run a snippet but I get this error. The snippet is:

addpath(genpath('D:\Program Files\MATLAB\R2018a\toolbox\MatConvNet_Vlfeat_Toolbox\matconvnet-1.0-beta25'));
net = load('Models/new-food-resnet-50-475-dag.mat');
net = dagnn.DagNN.loadobj(net);
net.mode = 'test';
net.vars(net.getVarIndex('pool5')).precious = 1;
im = imread('peppers.png');
im_ = single(im) ;
im_ = imresize(im_, net.meta.normalization.imageSize(1:2));
im_ = bsxfun(@minus, im_, net.meta.normalization.averageImage);
net.eval({'data', im_}) ; %Here I get the error

The full error is:

Attempt to execute SCRIPT vl_nnconv as a function:
D:\Program Files\MATLAB\R2018a\toolbox\MatConvNet_Vlfeat_Toolbox\matconvnet-1.0-beta25\matlab\vl_nnconv.m

Error in dagnn.Conv/forward (line 11)
      outputs{1} = vl_nnconv(...

Error in dagnn.Layer/forwardAdvanced (line 85)
      outputs = obj.forward(inputs, {net.params(par).value}) ;

Error in dagnn.DagNN/eval (line 91)
  obj.layers(l).block.forwardAdvanced(obj.layers(l)) ;

If I run > which -all vl_nnconv I get:

D:\Program Files\MATLAB\R2018a\toolbox\MatConvNet_Vlfeat_Toolbox\matconvnet-1.0-beta25\matlab\vl_nnconv.m
D:\Program Files\MATLAB\R2018a\toolbox\MatConvNet_Vlfeat_Toolbox\matconvnet-1.0-beta25\matlab\mex\vl_nnconv.mexw64  % Shadowed

Is this some problem with paths?

Automatik commented 6 years ago

Solved watching the quick start guide For resolving this path issue I needed to execute this command: > run matlab/vl_setupnn

shiqi1994 commented 4 years ago

Solved watching the quick start guide For resolving this path issue I needed to execute this command: > run matlab/vl_setupnn

Thanks. That helped a lot.