vlfeat / matconvnet

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

Problem with vl_nnconv #376

Closed TalhaMetu closed 8 years ago

TalhaMetu commented 8 years ago

Hi all,

I am using mathconvnet 1.0 beta17. I can compile the toolbox correctly. Everytime i try to execure the vl_nnconv, i get two errors. 1) First error is due to "opts" is given as cell array at vl_simplenn, i get "Cell contents reference from a non-cell array object." When i changed the code in vl_simplenn in vl_nnconv it doesnt give this error anymore. 2) Second error is "The option name is not a string (argument number 8)" At opts argument i didnt changed anything. I get this errors even if i use basic examples at mathconvnet websites and examples at mathconvnet folder i get same errors.

This is very imporant for me. Thank you

lenck commented 8 years ago

Hi, I think this happens when you use vl_arparse from vlfeat, not from MatConvNet. The vlfeat version does not support nested structures... At least this is what happens to me, usually... You can check this with which vl_argparse and then eventually fix it by first calling the vlfeat vl_setup and then the MatConvNet vl_setupnn (so that MatConvNet paths have a priority).

yhqlower commented 8 years ago

@lenck exactly! I've had the same problem several days ago. Since I did not use the files in /vlfeat/toolbox/misc, I just removed this directory out of the matlab path.

vedaldi commented 8 years ago

Hi, yes sorry for that, we shock update vlfeat.

However, there is a super easy fix: cal vl_setup before vl_setupnn (this will use MCN version).

On 5 Jan 2016, at 11:14, Colin Yan <notifications@github.com mailto:notifications@github.com> wrote:

@lenck https://github.com/lenck exactly! I've had the same problem several days ago. Since I did not use the files in /vlfeat/toolbox/misc, I just removed this directory out of the matlab path.

— Reply to this email directly or view it on GitHub https://github.com/vlfeat/matconvnet/issues/376#issuecomment-168963447.

TalhaMetu commented 8 years ago

Hi all, Thank you for your time and answers. But the point is i dont have vlfeat and vl_setup. So i am a little confused :/

lenck commented 8 years ago

When it crashes and you run which vl_argparse what does it return?

TalhaMetu commented 8 years ago

\Pattern Recognitiom Term Project\Without Cuda Codes\matconvnet-1.0-beta17\matlab\vl_argparse.m

TalhaMetu commented 8 years ago

When i delete opts i get: An input is not a SINGLE array nor it is empty. error. Thank you

lenck commented 8 years ago

Can you try it with the latest master from a fresh directory? You can get e.g. here: https://github.com/vlfeat/matconvnet/archive/master.zip There has been some bugs, so it might have been fixed...

TalhaMetu commented 8 years ago

Hi, i've just tried but again get same errors. Besides if i do:nt write opts.disableDropout=false; inside vl_simplenn i get sme errors. Also vl_convnn gives: Cell contents reference from a non-cell array object. if i give opts as a cell array not like (:). Thank you

lenck commented 8 years ago

Can you post the whole error? Opts should not be a cell array, that does not sound like the original quick start example...

TalhaMetu commented 8 years ago

training: epoch 01: batch 1/ 5: Cell contents reference from a non-cell array object.

Error in vl_simplenn (line 263) res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, ...

Error in cnn_weakly_label_train>process_epoch (line 283) res = vl_simplenn(net, im, dzdy, res, ...

Error in cnn_weakly_label_train (line 138) [net,stats.train] = process_epoch(opts, getBatch, epoch, train, learningRate, imdb, net) ;

Error in cnn_weakly_label (line 41) [net, info] = cnn_weakly_label_train(net, imdb, @getBatch, ..

Also my l looks like this :

ekran alintisi

TalhaMetu commented 8 years ago

Also same error with mnist example ekran alintisi

lenck commented 8 years ago

Ah, I see... That may be a bad initialization - in the beta-17 the layer opts has been added to the network structure. You can fix it if you add:

net = vl_simplenn_tidy(net) ;

before calling the [net, info] = cnn_weakly_label_train(net, imdb, @getBatch, .. in cnn_weakly_label...

lenck commented 8 years ago

And the bug in cnn_mnist has been fixed in the master branch... It was exactly the same issue :)

TalhaMetu commented 8 years ago

But i use master branch and i get still same error at mnist :( When i used that code in my program it says :+1: An input is not a SINGLE array nor it is empty. he res(i).x and other stride etc is not empty

I am so sorry about occupying you. Thank you for your time and answers

TalhaMetu commented 8 years ago

Can this be about the compiler that use on MATLAB? It is Microsoft Windows SDK 7.1 (C++). Although i dont get any errors when i am compiling it

vedaldi commented 8 years ago

Hi, I should add that _tidy needs to be called only once after loading the network.

Basically, it will upgrade the network structure to the latest MatConvNet version. It also fills in default values for unspecified parameters, so it is a bit easier to create new simplenn models.

On 5 Jan 2016, at 16:25, Karel Lenc notifications@github.com wrote:

Ah, I see... That may be a bad initialization - in the beta-17 the layer opts has been added to the network structure. You can fix it if you add:

net = vl_simplenn_tidy(net) ;

before calling the [net, info] = cnn_weakly_label_train(net, imdb, @getBatch, .. in cnn_weakly_label...


Reply to this email directly or view it on GitHub: https://github.com/vlfeat/matconvnet/issues/376#issuecomment-169075235

TalhaMetu commented 8 years ago

For the ones who suffers from same problem with me: I am using PASCAL VOC2012 dataset. Even if error is "An input is not a SINGLE array nor it is empty." You should give your input res(i).x as single(res(i).x) . I think this is because of MATLAB and GPU data type differencies but i am not that sure.

Thank you all guys for your valuable time and your study :)

liquidmetal commented 8 years ago

Was this ever resolved? I'm running into this exact issue.

zgplvyou commented 8 years ago

the same issue to you!!How to solve it?

k8280627 commented 7 years ago

TalhaMetu adding the single() works for me!!

OluwoleOyetoke commented 7 years ago

Hi @k8280627. I am having a similar challenge here. Whenever I try to convert my DAG structure tos simplenn -----net_dag= vl_simplenn_tidy(net_dag) ;----, I get the error 'Cell contents reference from a non-cell array object'....Do you have a solution to this problem?

k8280627 commented 7 years ago

@OluwoleOyetoke I have never had this problem, but from the error message, is it possible that your net_dag is not a cell-array? could you convert it to a cell-array?

ghazalee70 commented 7 years ago

I am also getting the same error although all the inputs and parameters are gpu arrays: input{1}: 256 256 3 10 params{1}: 7 7 3 64 params{2}: 64 1 Error using vl_nnconv An input is neither SINGLE or DOUBLE nor it is empty. Can anyone please help me regarding this issue?

hhamin commented 6 years ago

@OluwoleOyetoke Ihave the same problem when I've tried using cnn_vgg_faces.m. the problem is due to that net.layers have some empty structures. I'll try remove these empty structures.

OluwoleOyetoke commented 6 years ago

Okay, @hhamin . I hope the problem is solved now