Saving a neural network within a GUI and opening it back up

3 ビュー (過去 30 日間)
Harold
Harold 2013 年 5 月 1 日
I'm having problems with saving a neural network and loading it back up. Refer to this post that I made in regards to loading a saved neural network ( saved from the workspace not the GUI) http://www.mathworks.com/matlabcentral/answers/74032-problems-with-a-saved-neural-network
I was having problems saving a trained neural network. I kept getting the error saying that 'handles.neural_net' is not a valid variable name. I then realized that Matlab does not like '.' in variable names. So within my save neural network callback I created a variable save_net = handles.neural_net. I used this variable in save(). This worked.
Now when I open this trained network and hit my "run neural network" button, I get an error saying 'model' parameter must be a string.
As mentioned in the link posted above, I use the code below to load the saved network. Can anyone find what I'm doing wrong with saving and loading neural networks using handles? I need to be able to use handles for the neural network because it gets passed around from the file select callback to the training or run callback (depending on if you are performing a training or run of the network).
trained_net_vars = load(FileName);
handles.neural_net = trained_net_vars.net;
Note: The training, running, and saving of the network is all done in the GUI. I want to be able to simulate the network using a different input than the input used for training.

採用された回答

Walter Roberson
Walter Roberson 2013 年 5 月 1 日
If the variable you are saving into is named "save_net", then the field name you used after trained_net_vars needs to be "save_net".

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by