开发者

Why can't Matlab R2010 load neural network objects from R2007?

开发者 https://www.devze.com 2023-04-06 03:54 出处:网络
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.

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开发者_如何学Python 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:

If you see this issue in the future, please contact Technical Support and refer to solution 1-EGNM3S.

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 myvarname to check. To "revive" this struct into an object it needs to be processed by the overloaded loadobj function for its object type, which is usually automatically called by MATLAB's load function. In this case the loadobj that comes with the neuronal network object in R2010 seems to not be fully backwards compatible...


I suspect that the underlying objects for the neural net have changed since 2007b and that the definition in R2010b is not compatible with the data stored in the MAT-file.

I recommend following Jonas's answer. Alternatively, you might try loading it and re-saving it in an intermediate MATLAB release, or saving the data from the neural net objects and rebuilding it in R2010b.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号