I have a Neural Network that I’ve save to a .mat file in Matlab 2007.
I’m trying to load the neural network from the file with load filename.mat.
This worked great with versions R2007b and R2008, but when I try to load in R2010b I get the following message:
Warning: An error occurred when running a class’s
loadobj method. The object that was loaded from the
MAT-file was a copy of the object before the loadobj
method was run. The rest of the variables were also
loaded from the MAT-file.
The encountered error was:
Reference to non-existent field ‘name’
The weird thing is that it appears as if the variable holding the Neural Network exists, but it’s not working properly. None of the functions that use the neural network work in R2010.
Has anyone encountered a similar problem ? How can I save the Neural Network so it will be compatible with Matlab R2010?
Or even better, how can I just load it properly in Matlab 2010?
Yes, it seems other people have encountered this problem (neural networks not loading in MATLAB 2010), according to this MATLAB Central post, in which Andreas Goser (Technical Support Manager at Mathworks) suggests:
Apparently you need “a fixed net.m file” which technical support can provide. I haven’t tested it, since I don’t have that problem myself.
Carefully reading the error message, I would say that the variable you see loaded contains the “raw” object that was stored in the .MAT file, quite possibly a struct. You can run
whos myvarnameto check. To “revive” this struct into an object it needs to be processed by the overloadedloadobjfunction for its object type, which is usually automatically called by MATLAB’sloadfunction. In this case theloadobjthat comes with the neuronal network object in R2010 seems to not be fully backwards compatible…