MATLAB Answers

0

Loading a saved deep learning network into matlab

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.

  0 件のコメント

サインイン to comment.

3 件の回答

回答者: 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.

  0 件のコメント

サインイン to comment.


回答者: Divya Gaddipati 2019 年 10 月 29 日

Hi,
Instead of
save net;
try using
save('net.mat', 'net');
and see if that works.

  0 件のコメント

サインイン to comment.


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.

  0 件のコメント

サインイン to comment.



Translated by