Loading a saved deep learning network into matlab
Show older comments
I am trying to import my saved vgg19 network into a different matlab script in order to perform image classification.
So I performed transfer learning on the original vgg 19 network using the code of https://nl.mathworks.com/help/deeplearning/examples/transfer-learning-using-alexnet.html. I saved to modified vgg19 network with
save net;
This creates a '.mat' file in the directory that I am currently in. However when I load this file into a new project for instance it import each variable of the network as a seperate variable. When I look what is in the 'net' variable which is a DAGNetwork as expected has 2 properties: layers and connections. But these properties don't include anything while it is expected that they include a 47x1 layer and 46x2 table.
When I look at the size of the DAGNetwork is also shows it is completely empy (0 Bytes) while I expect this to be around 500 MB.
I really don't know what I am doing wrong as I have been looking on the internet for the correct way of importing a saved network into matlab.
Accepted Answer
More Answers (2)
Divya Gaddipati
on 29 Oct 2019
Hi,
Instead of
save net;
try using
save('net.mat', 'net');
and see if that works.
Steven Lord
on 29 Oct 2019
1 vote
According to the documentation page for the vgg19 function "This function requires Deep Learning Toolbox™ Model for VGG-19 Network support package." Is this support package installed on the machine where you're trying to load the network? I would have expected you to receive a warning when you tried to load the network onto the machine if you don't, but it's possible to disable that warning even if I don't recommend doing so.
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!