Loading a saved deep learning network into matlab

21 ビュー (過去 30 日間)
lukas mattheuwsen
lukas mattheuwsen 2019 年 10 月 18 日
回答済み: lukas mattheuwsen 2019 年 10 月 30 日
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.

採用された回答

lukas mattheuwsen
lukas mattheuwsen 2019 年 10 月 30 日
Apperently it didn't had to do with the way I tried to save and import the network but with the version I used to save it and than load it again. You see, I trained the network on a workstation which has multiple GPUs, more RAM and a more powerful CPU than my personal laptop at work. But as testing the network doesn't really require a powerful PC, I transfered the trained network files to my own laptop to test the network. Training the network was done in Matlab 2019a while I have 2018b on my laptop. This resulted in the network to be empy as I imported it matlab 2018b.
Moral of the story is to not use different versions of matlab in the same project!
But thanks to everyone for their sugestions.

その他の回答 (2 件)

Divya Gaddipati
Divya Gaddipati 2019 年 10 月 29 日
Hi,
Instead of
save net;
try using
save('net.mat', 'net');
and see if that works.

Steven Lord
Steven Lord 2019 年 10 月 29 日
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.

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by