Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problem with running vl_simplenn.m #131

Closed
huangsjb opened this issue May 4, 2015 · 14 comments
Closed

Some problem with running vl_simplenn.m #131

huangsjb opened this issue May 4, 2015 · 14 comments

Comments

@huangsjb
Copy link

huangsjb commented May 4, 2015

Hi, I have encountered some problem in trying to run vl_simplenn.m to test the model.

I simply run the sample code in the following tutorial:
http://www.vlfeat.org/matconvnet/pretrained/

And the following error message is printed:
" Reference to non-existent field 'filters'.

Error in vl_simplenn (line 153)
res(i+1).x = vl_nnconv(res(i).x, l.filters, l.biases, 'pad', l.pad, 'stride', l.stride) ;

Error in cnn_test (line 16)
res = vl_simplenn(net, im_) ; "

If someone has encountered the same problem as running the sample code? or have any experience on dealing with it?

Thanks a lot anyway.

@geyun12
Copy link

geyun12 commented May 4, 2015

I meet the same problem with you... hope someone help us.

@huangsjb
Copy link
Author

huangsjb commented May 4, 2015

Also, I tried to do prediction using the cnn_mnist.m in the examples folder.

By changing the last layer to "softmax" (as discussed in #34), it works. But the tutorial example problem is not solved yet.

@geyun12
Copy link

geyun12 commented May 4, 2015

If I used the imagenet-vgg-f model,then it runs successfully. But when I used the imagenet-vgg-verydeep-16, then I meet the same problem as yours.

@Jerrynet
Copy link

Jerrynet commented May 5, 2015

@huangsjb you can update matconvnet to the latest version (1.0-beta11), which supports legacy net structure.
They updated net weight structure from '.filters'/'.biases' to '.weights'
A quick workaround is change the code to this:

res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, 'pad', l.pad, 'stride', l.stride) ;

Edit: beta12 comes with a 'legacy net' option, so no need to modify it.

@wangchuanxd
Copy link

@huangsjb Maybe your training network did not parallel for your training data setting. As you said ,you changed the layer to "softmax" and it worked.

@isalirezag
Copy link

I have the same issue.
Could anyone solve this problem?

I am just trying to use the pre-train model:

run vl_setupnn
net = load('imagenet-vgg-f.mat') ;

% obtain and preprocess an image
im = imread('lena.bmp') ;
im_ = single(im) ; % note: 255 range
im_ = imresize(im_, net.normalization.imageSize(1:2)) ;
im_ = im_ - net.normalization.averageImage(1) ;
% run the CNN
res = vl_simplenn(net,im_) ;

I received this error as well:

Error in vl_simplenn (line 178)
res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, 'pad', l.pad, 'stride',
l.stride) ;

@Mona77
Copy link

Mona77 commented May 28, 2015

I get the same error as well:

Attempt to execute SCRIPT vl_nnconv as a function:
/home/m/matconvnet-1.0-beta12/matlab/vl_nnconv.m

Error in vl_simplenn (line 178)
res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, 'pad', l.pad, 'stride', l.stride) ;

Error in pre_train_vgg_s (line 15)
res = vl_simplenn(net, im_) ;

@wangchuanxd
Copy link

Sorry for replying your problem so late. I encountered the problem when I setted the error parameters beteween two layers. Then, I fixed the parameters and it worked.

wangchuansnnu@163.com

From: Mona Fathollahi
Date: 2015-05-28 12:53
To: vlfeat/matconvnet
CC: wangchuanxd
Subject: Re: [matconvnet] Some problem with running vl_simplenn.m (#131)
I get the same error as well:
Attempt to execute SCRIPT vl_nnconv as a function:
/home/m/matconvnet-1.0-beta12/matlab/vl_nnconv.m
Error in vl_simplenn (line 178)
res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, 'pad', l.pad, 'stride', l.stride) ;
Error in pre_train_vgg_s (line 15)
res = vl_simplenn(net, im_) ;

Reply to this email directly or view it on GitHub.

@arjunrajanna
Copy link

I am trying to use it for cifar.
I get the same error as well. I am using the option "legacy net".

Thanks

@arjunrajanna
Copy link

Could some one help out?

@arjunrajanna
Copy link

Compiled the mex files with "vl_compilenn". That works.

@lenck
Copy link
Contributor

lenck commented Apr 15, 2016

Hi, Attempt to execute SCRIPT vl_nnconv as a function: is because the MatConvNet is not compiled. You should run vl_compilenn.
The error " Reference to non-existent field 'filters'. means that your network is of the old format. Use the vl_simplenn_tidy which would fix it.
Hope that this would help a bit! :)

@lenck lenck closed this as completed Apr 15, 2016
@cora9298
Copy link

use 'net.meta.normalization' instead of 'net.normalization'

@sabirdvd
Copy link

sabirdvd commented Nov 24, 2017

I think this is a bug in the framework when you try to run more than 2 or 3 networks at same time, workspace, clear cmd doesn’t work either, only solution is to restart MATLAB and run the same lines again. What I did, I run the first network then I saved the weight then I restarted MATLAB, then I run the another one. I tried with this two laptops to confirm this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants