vlfeat / matconvnet

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

Multiple Errors when transforming AlexNet to DagNN model #610

Open zhaolewen opened 8 years ago

zhaolewen commented 8 years ago

Hi,

I met this problem when I wanted to transform the simple AlexNet NN to DagNN, with the file imagenet-matconvnet-alex:

Matlab command: alexdag = DagNN.fromSimpleNN(alex)

Error:

Cell contents reference from a non-cell array object.

`Error in vl_simplenn_move (line 21) switch net.layers{l}.type

Error in dagnn.DagNN.fromSimpleNN (line 54) net = vl_simplenn_move(net, 'cpu') ;'

I searched on the internet, and found this answer: https://fr.mathworks.com/matlabcentral/answers/157686-cell-contents-reference-from-a-non-cell-array-object

So I edited the 21st line of vl_simplenn_move.

Then I executed the transformation again, and it gave me another error:

Cell contents reference from a non-cell array object. 'Error in vl_simplenn_tidy (line 37) layer = net.layers{l} ;

Error in dagnn.DagNN.fromSimpleNN (line 55) net = vl_simplenn_tidy(net) ;'

So I applied the same correction again.

Then I executed the transform command the third time, and it gave me this error: 'Error using dagnn.DagNN.fromSimpleNN (line 164) dagnn.Conv is unsupported'

So I went to the line 164, and found this: 'otherwise error([net.layers{l}.type ' is unsupported']) ;'

And above, on the line 76, there is this: 'case {'conv', 'convt'}'

'case {'conv', 'convt','dagnn.Conv'}'

But now, it pops me this message:

Index exceeds matrix dimensions.

'Error in dagnn.DagNN.fromSimpleNN (line 77) sz = size(net.layers{l}.weights{1}) ;'

And I have to give up...

So am I doing it right ? How to fix this problem ?

Thanks !

lenck commented 8 years ago

Hi, try:

alexdag = DagNN.fromSimpleNN(vl_simplenn_tidy(alex));
vwadia commented 5 years ago

Hi Lenck, this does not work...the same error arises. vl_simplenn_tidy is unable to run as well because of the same issue