sdemyanov / ConvNet

Convolutional Neural Networks for Matlab for classification and segmentation, including Invariang Backpropagation (IBP) and Adversarial Training (AT) algorithms. Trained on GPU, require cuDNN v5.
240 stars 141 forks source link

Undefined function 'flip' for input arguments of type 'single'. #13

Closed mrgloom closed 9 years ago

mrgloom commented 9 years ago

I tried to run cnnexamples.m(funtype = 'matlab';) and get error

Undefined function 'flip' for input arguments of type 'single'.

Error in flipall (line 3) X = flip(X, dimind);

Error in filtn (line 3) c = convn(a, flipall(b), type);

Error in forward (line 38) layers{l}.a(:, :, i, :) = layers{l}.a(:, :, i, :) + ...

Error in cnntrain_mat (line 44) [layers, pred] = forward(layers, 1);

Error in cnntrain (line 12) [weights, trainerr] = cnntrain_mat(layers, weights_in, params, train_x, train_y);

Error in cnnexamples (line 77) [weights, trainerr] = cnntrain(layers, weights, params, train_x, train_y, funtype);

how can it be resolved? I'm using Matlab R2012a win7 x64.

mrgloom commented 9 years ago

Looks like it doesn't work on old Matlab.

Tried 2014a and it's ok.

sdemyanov commented 9 years ago

In Matlab you can also use double precision instead of single. Just change single on double everywhere in cnnexamples and cnnsetup.

diegostefano commented 9 years ago

I'm using R2013a, and solved this issue by replacing the "flip" function by "flipdim".