Conversion to struct from double is not possible- Neural Network Pattern Recognition Toolbox

Hello. I'm trying to execute the simplest example for Pattern recognition network, given in this link http://www.mathworks.fr/fr/help/nnet/ref/patternnet.html for iris flowers classification.
[x,t] = iris_dataset;
net = patternnet(10)
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,t,y)
classes = vec2ind(y)
Error using struct Conversion to struct from double is not possible.
And it's the same error if I use the Neural Network interface. Can anyone help me, please? Thank you very much!

4 件のコメント

Jan
Jan 2013 年 7 月 28 日
Please be so kind and post the complete error message. Most of all show us the line, which causes the error and explain the type of the used variables.
Don Mathis
Don Mathis 2014 年 6 月 14 日
編集済み: John D'Errico 2014 年 6 月 15 日
When I cut and paste his code (on a mac running R2014a and MacOS 10.9.3), I get this error:
Error using struct
Conversion to struct from double is not possible.
Error in network/subsasgn>getDefaultParam (line 2048)
param = struct(feval(fcn,'defaultParam'));
Error in network/subsasgn>setLayerTransferFcn (line 1224)
net.layers{i}.transferParam = getDefaultParam(transferFcn);
Error in network/subsasgn>network_subsasgn (line 208)
if isempty(err), [net,err] =
setLayerTransferFcn(net,i,transferFcn); end
Error in network/subsasgn (line 13)
net = network_subsasgn(net,subscripts,v,netname);
Error in patternnet>create_network (line 104)
net.layers{net.numLayers}.transferFcn = 'softmax';
Error in patternnet (line 71)
net = create_network(param);
Don Mathis
Don Mathis 2014 年 6 月 14 日
編集済み: Don Mathis 2014 年 6 月 14 日
I discovered that the cause of my replication of your error was the fact that I had redefined the 'softmax' function in my MATLAB workspace. There are a number of functions that would cause this error if you redefine them, such as: netsum purelin tansig dividerand mse adaptwb learngdm crossentropy softmax
LuMig
LuMig 2019 年 11 月 8 日
Also my case.Thumbs up

サインインしてコメントする。

 採用された回答

Greg Heath
Greg Heath 2013 年 7 月 28 日

1 投票

I cut and pasted your code. It ran with no problem or messages.

その他の回答 (3 件)

MHS
MHS 2018 年 4 月 27 日

1 投票

I faced similar problem and it was resolved by resetting the workspace path list to default.
ahmad ali mohammad
ahmad ali mohammad 2016 年 11 月 9 日

0 投票

I was faced with the same problem When I run certain code occurs after you run this code I have to remove and re-install MATLAB
Afonso Costa
Afonso Costa 2018 年 12 月 1 日
編集済み: Afonso Costa 2018 年 12 月 1 日

0 投票

I found a solution for this problem. I think it is clashing with another function you may have.
To solve, go to Environment > Set Path, then move all the directories you included (from other toolboxes) to the end of the entries.
For me, worked like a charm!

質問済み:

2013 年 7 月 28 日

コメント済み:

2019 年 11 月 8 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by