ERROR in feedforwardnet (Default value is not a member of type "nntype.training_fcn".)
Show older comments
Why do I receive the following error when Tried to run the example:
This is my full code : Line 22 is the line with 'trainbr'.
clear
clc
close all
% With Noise
%
%%%%%%%%%%%
%algorlm.m
% A script comparing performance of different algorithms
% traingd - batch gradient descent
% trainlm - Levenberg - Marquardt
% traingda
% traincgf
% traincgp
% trainbfg
%%%%%%%%%%%
%generation of examples and targets
x=0:0.2:4*pi;
y=sin(x);
p=con2seq(x); t=con2seq(y); % convert the data to a useful format
%creation of networks
net1=feedforwardnet(20,'trainbr');
net2=feedforwardnet(20,'traingd');
The error is :
Default value is not a member of type "nntype.training_fcn".
Error using nnetParamInfo (line 28)
FCN does not return an info object.
Error in feedforwardnet>get_info (line 87)
nnetParamInfo('trainFcn','Training Function','nntype.training_fcn','trainlm',...
Error in feedforwardnet (line 39)
if isempty(INFO), INFO = get_info; end
Error in backpropag_noisydata (line 22)
net1=feedforwardnet(20,'trainbr');
Its just the given example which I try to run. But still it just throws me an error figuring out looks difficult.
5 Comments
Greg Heath
on 8 May 2017
Confusing.
The code in the error message does not match that in the bodyfat example.
Just post your entire code, with error messages, resulting from using the exact code in the example.
Then repeat, substituting your data for bodyfat.
A strict comparison should help us help you.
Hope this helps.
Greg
Marimuthu Ananthavelu
on 9 May 2017
Edited: Marimuthu Ananthavelu
on 9 May 2017
Walter Roberson
on 11 May 2017
That does not happen for me with your code in R2017a. Which MATLAB version are you using?
Marimuthu Ananthavelu
on 21 May 2017
Walter Roberson
on 22 May 2017
I have not been able to reproduce this in R2017a on OS-X
Answers (1)
Wilson A N
on 11 May 2017
I was not able to reproduce the issue at my end. But, I suspect that this behavior is caused due to a path issue or due to one or more default functions being shadowed.
Can you please execute the following commands in MATLAB command window
>> restoredefaultpath
>> rehash toolboxcache
Since this looks like an issue with the MATLAB search path, "restoredefaultpath" will try and reset it to the default path. This command sets the search path to include only folders for MathWorks installed products.
Using the "rehash" command updates the MATLAB list of known files on the search path.
Please execute the script and check if the issue still persists.
More information on "restoredefaultpath" and "rehash" are found in the following link:
2 Comments
Daniel Perez Rapela
on 24 Oct 2018
I just had the same problem and this solved it. Thanks!
An
on 6 Jul 2024
This method works for this problem! Thanks!
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!