Matlab 使用caffe提取过滤器和偏差

Matlab 使用caffe提取过滤器和偏差,matlab,machine-learning,neural-network,deep-learning,caffe,Matlab,Machine Learning,Neural Network,Deep Learning,Caffe,我想从我自己的CAFEMODEL中提取过滤器和偏差(无需可视化该功能),并将它们保存到.mat文件中,用于MATLAB。 我使用matcaffe来处理此问题: 我的解决方法: addpath('/home/jensen810814/code/caffe/matlab/caffe/'); addpath('/home/jensen810814/code/caffe/examples/super_resolution/'); addpath('/home/jensen810814/code/caff

我想从我自己的CAFEMODEL中提取过滤器和偏差(无需可视化该功能),并将它们保存到
.mat
文件中,用于
MATLAB
。 我使用
matcaffe
来处理此问题:

我的解决方法:

addpath('/home/jensen810814/code/caffe/matlab/caffe/');
addpath('/home/jensen810814/code/caffe/examples/super_resolution/');
addpath('/home/jensen810814/code/caffe/examples/super_resolution/Model/');
caffe('init','deploy.prototxt','super_resolution_iter_1000.caffemodel');
caffe('forward',{});
weights = caffe('get_weights');
save('/home/jensen810814/code/caffe/examples/super_resolution/filter_data.mat','weights');
但是发生了一些错误:

Error using caffe
Expected 3 arguments, got 2
Error in model (line 4)
caffe('init','supe_resolution_train_test.prototxt','super_resolution_iter_1000.caffemodel');
我不知道如何解决这个问题。
有人能帮我吗?谢谢。

您需要为
'init'
阶段名称提供一个附加参数。
我相信你的情况

 caffe('init',...
       'supe_resolution_train_test.prototxt',...
       'super_resolution_iter_1000.caffemodel',...
       'test');