Neural net default error: "Default value is not a member of type "nntype.distance_fcn"."

2 vues (au cours des 30 derniers jours)
I have not used any neural net programs before, and am trying the built-in neural net example called "Simple Clusters" via the Gui App. When I load the example data, and choose the default 10 neurons, I get this error:
Default value is not a member of type "nntype.distance_fcn".
As far as I know, I have not changed any default settings, the distanceFnc is still the default "linkdist", which exists in my path. Any suggestions would be appreciated. Thanks,
  2 commentaires
Greg Heath
Greg Heath le 20 Fév 2014
Show relevant code and error messages
Jipei Chen
Jipei Chen le 9 Jan 2020
I also encountered the same problem. Is there any solution currently? Is it a source code issue?

Connectez-vous pour commenter.

Réponse acceptée

Greg Heath
Greg Heath le 25 Fév 2014
1. Review
a. doc selforgmap
b. help selforgmap
2.What happens when you cut and paste the help example with each of the following alternatives:
net = selforgmap;
net = selforgmap( [8 8]);
net = selforgmap( [8 8],100,3,'hextop',linkdist' );
Hope this helps
Greg
  2 commentaires
Emily
Emily le 25 Fév 2014
Thanks again. I tried these with the same results as the first. I have read the doc and help, and done multiple google searches to try to understand. I purchased and installed the neural net toolbox several months after the rest of matlab, maybe I will reinstall so all toolboxes are recognized from the beginning.
>> net = selforgmap;
Default value is not a member of type "nntype.distance_fcn".
Error using nnetParamInfo (line 28)
Not enough input arguments.
Error in selforgmap>get_info (line 88)
info = nnfcnNetwork(mfilename,'Self-Organizing Map',fcnversion, ...
Error in selforgmap (line 44)
if isempty(INFO), INFO = get_info; end
>> net = selforgmap( [8 8]);
Default value is not a member of type "nntype.distance_fcn".
Error using nnetParamInfo (line 28)
Not enough input arguments.
Error in selforgmap>get_info (line 88)
info = nnfcnNetwork(mfilename,'Self-Organizing Map',fcnversion, ...
Error in selforgmap (line 44)
if
isempty(INFO), INFO = get_info; end
>> net = selforgmap( [8 8],100,3,'hextop','linkdist' );
Default value is not a member of type "nntype.distance_fcn".
Error using nnetParamInfo (line 28)
Not enough input arguments.
Error in selforgmap>get_info (line 88)
info = nnfcnNetwork(mfilename,'Self-Organizing Map',fcnversion, ...
Error in selforgmap (line 44)
if isempty(INFO), INFO = get_info; end
Greg Heath
Greg Heath le 26 Fév 2014
Why don't you cut and paste the examples in
help fitnet
and
help patternnet
to see if the NNTBX works at all

Connectez-vous pour commenter.

Plus de réponses (3)

Monique
Monique le 17 Mar 2016
Modifié(e) : Monique le 17 Mar 2016
In case someone ends up here after googling the issue like I did, since I am afraid Greg's answer was not particularly useful... What happened in my case (and what may be the issue for you as well) was that I had a function in my path, conflicting with the toolbox - in my case a dist.m I wrote a long time ago and had forgotten about. So you might want to check whether there is a dist.m in your path.
If not, run net = selforgmap; right when launching a "clean" version of matlab with no personal directories added to the path. If it works, add paths in your directories one by one (addpath/rmpath) until you narrow down which one causes the function to fail, and then narrow down to the function... (since I had no idea what I was looking for, once I found the directory I had to remove functions from it until I found which one was the culprit). Hope it helps!
  4 commentaires
Sinan Islam
Sinan Islam le 11 Jan 2021
Thanks alot Monique. I had a function called dist.m
Honestly, I find it a bit weird that matlab core functions and toolboxes functions do not have their own namespace. Also, I am not sure if matlab have the concept of Environments. Anyhow, I renamed the function and the issue was fixed.
Emily
Emily le 11 Jan 2021
Modifié(e) : Emily le 11 Jan 2021
Yes, thanks Monique! I have a function dist.m, too! The problem disappeared when I worked on a version matlab without any of my personal paths installed. (@Sinan Islam) thanks for bumping this up!

Connectez-vous pour commenter.


Greg Heath
Greg Heath le 24 Fév 2014
If you can't figure it out, try the command line approach and keep my comment in mind.
Hope this helps.
Thank you for formally accepting my answer
Greg
  1 commentaire
Emily
Emily le 24 Fév 2014
Thanks for your answer, but I have tried on the command line, too and get the same error, although a bit more information on the error.
>> net = selforgmap([8 8]);
Default value is not a member of type "nntype.distance_fcn".
Error using nnetParamInfo (line 28)
Not enough input arguments.
Error in selforgmap>get_info (line 88)
info = nnfcnNetwork(mfilename,'Self-Organizing Map',fcnversion, ...
Error in selforgmap (line 44)
if isempty(INFO), INFO = get_info; end

Connectez-vous pour commenter.


Daniel Perez Rapela
Daniel Perez Rapela le 24 Oct 2018
I just found the solution here: https://www.mathworks.com/matlabcentral/answers/339194-error-in-feedforwardnet-default-value-is-not-a-member-of-type-nntype-training_fcn#answer_266546

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by