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

How to use matcaffe to extract filters #2338

Closed
jensen810814 opened this issue Apr 19, 2015 · 3 comments
Closed

How to use matcaffe to extract filters #2338

jensen810814 opened this issue Apr 19, 2015 · 3 comments

Comments

@jensen810814
Copy link

Hi all,
I'm trying to extract filters and biases by matcaffe.
The following is my code:

addpath('/home/jensen810814/code/caffe/matlab/caffe/');
addpath('/home/jensen810814/code/caffe/examples/super_resolution/');
addpath('/home/jensen810814/code/caffe/examples/super_resolution/super_resolution_lmdb_data/');
addpath('/home/jensen810814/code/caffe/examples/super_resolution/Model/');
caffe('init','deploy.prototxt', 'super_resolution_iter_1000.caffemodel','test');
caffe('forward',{});
weights = caffe('get_weights');
save('/home/jensen810814/code/caffe/examples/super_resolution/filter_data.mat','weights');

But it shows an error message :

Error using caffe
Invalid input size
Error in model (line 9)
caffe('forward',{});

I dont know what the error mean and how to solve it.
I am a beginner in caffe,..can anyone help me? Please and thanks.

@weiliu89
Copy link

@jensen810814 You don't need to have "caffe('forward',{});", simply get_weights after you initialize

@jensen810814
Copy link
Author

it works!! Thanks for your answer !! So kind of you.

@shelhamer
Copy link
Member

I'm happy to see an answer from the community, but please ask usage questions on the caffe-users group.

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

3 participants